answersLogoWhite

0


Best Answer

Primitive types are the data types provided by a programming language as basic building blocks. Primitive types are also known as built-in types or basic types.

Depending on the language and its implementation, primitive types may or may not have a one-to-one correspondence with objects in the computer's memory. However, one usually expects operations on primitive types to be the fastest language constructs there are. Integer addition, for example, can be performed as a single machine instruction

User Avatar

Wiki User

11y ago
This answer is:
User Avatar
More answers
User Avatar

Wiki User

14y ago

A primitive data structure is generally a basic structure that is usually built into the language, such as an integer, an array or a linked-list.

A non-primitive data structure is built out of primitive data structures linked together in meaningful ways, such as a binary search tree, AVL Tree, Hashtable, etc.

This answer is:
User Avatar

User Avatar

Wiki User

15y ago

Primitive types are declaration types and the primitive type is already defined by the java programming language. There are eight primitive types defined in java:

int, char, boolean, short, void,long, float ,double. Non primitive types are called java reference types and they have name starting with capital letter. Eg: Integer, Float etc

For these primitives you cannot create instances but for the non primitives you can create the instances.

This answer is:
User Avatar

User Avatar

Wiki User

11y ago

A primitive is a data structure defined by the language's core specification, which is usually reserved as a keyword, such as a char, int, or double. A non-primitive data structure consists of multiple primitive structures joined together in some fashion, and requires special processing libraries in order to be used. For example, the addition operator (+) knows how to add one int to another int, but it does not know how to add a "rect" (a rectangle, with a width and height) to another "rect". To allow this operation, an "operator overload" is required to instruct the addition operator how to behave when it is provided with two "rect" structures.

This answer is:
User Avatar

User Avatar

Wiki User

11y ago

PRIMITIVE DATATYPE

The primitive data types are the basic data types that are available in most of the programming languages. The primitive data types are used to represent single values.

  • Integer: This is used to represent a number without decimal point.

Eg: 12, 90

  • Float and Double: This is used to represent a number with decimal point.

Eg: 45.1, 67.3

  • Character : This is used to represent single character

Eg: 'C', 'a'

  • String: This is used to represent group of characters.

Eg: "M.S.P.V.L Polytechnic College"

  • Boolean: This is used represent logical values either true or false.

NON-PRIMITIVE DATATYPES

The data types that are derived from primary data types are known as non-Primitive data types. These datatypes are used to store group of values.

The non-primitive data types are

  • Arrays
  • Structure
  • Union
  • linked list
  • Stacks
  • Queue etc
This answer is:
User Avatar

User Avatar

Wiki User

12y ago

A primitive data type is one that fits the base architecture of the underlying computer, such as int, float, and pointer, and all of the variations thereof, such as char, short, long, unsigned, float, double, near, far, huge, and flat.

A non-primitive data type is something else, such as an array, structure, or class.

This answer is:
User Avatar

User Avatar

Wiki User

11y ago

A primitive is the simplest possible data structure. In Java, for example, that includes int, long (two integers of different length), float, double (two floating-point numbers of different size), boolean (a boolean or logical variable), char (a single character). In Java, primitive variables are usually stored on a memory structure called the stack.

The other type of data is usually made up of more than one primitive (or even non-primitive) data type, and may include (in different languages), struct or records, and objects. In Java, objects are usually used; these are stored on a memory structure called the heap.

This answer is:
User Avatar

User Avatar

Wiki User

9y ago

The main difference between primitive and non-primitive data structure is their value. Non-primitive types will always have a reference value, and primitive types have an absolute value.

This answer is:
User Avatar

User Avatar

Wiki User

13y ago

Primitives such as int, long, boolean are not objects thus have no methods.

This answer is:
User Avatar

Add your answer:

Earn +20 pts
Q: Data types in c primitive and non primitive?
Write your answer...
Submit
Still have questions?
magnify glass
imp
Continue Learning about Engineering

What is different between primitive date type and non primitive data type in c plus plus programming language?

A primitive data type is built into the language - int, char, long, etc. A non-primitive data type is am abstract data type that is built out of primitive data types - linked list, queue, stack, etc.


Why c plus plus called as paritial oop?

C++ is only partially OOP because it is a superset of C and, for the sake of backward compatibility, retains the concept of primitive data types (such as integrals like char and int) and pointer data types, which are all strictly non-object-oriented. In Java and C#, there is no concept of a primitive data type. Even integral types such as int are treated as objects and there is no concept of a pointer data type.


What is primary data type in C?

The terms "primary data type" and "secondary data type" are not exactly correct when working in C. Instead, C has what are called "primitive data types" or, in some references, "basic types" - types which can be affected by arithmetic operators. Other data types include structs, arrays, and unions. Structs, arrays and unions cannot be affected as a whole by arithmetic operators, although the members within that are primitive data types can be. Pointers can technically be affected by arithmetic operators, particularly +, -, ++ and --, but because their values are expected to be used as addresses, they're not considered to be primitive in nature. There are three primitive data types in C: integers, real numbers and complex numbers. Integers have no decimal points and can be signed or unsigned, and real and complex numbers are signed and have decimal points. Boolean types are represented by integers, most commonly "int" under Posix-style systems. More information about primitive data types can be found in the related links below


Is string arr a non primitive data type?

Depends on the context of the question you were asking from, there are 2 distinct answers: Yes and NO. In the narrowest definition, any array is NOT a primitive data type in C#. Hence a string array is NOT a primitive data type in that context. A string itself, however, is a primitive data type. Some developers would like to extend the definition of "primitives" into the arrays, collections, and Enumeration. Thus, in this context, an array of string IS a primitive data type.


What is non primitive data types in Java?

"Primitive" data types are integers (char, int, long), floats (float, double) and void. Void is never used for variables, but tells C that a function accepts and/or returns no arguments. "Non-primitive" data types include arrays, structs and classes. These utilize primitive data types and are called, in general, structured data types. Data types can become more complicated as you mix the structured data types. For instance, arrays, structs and classes can contain arrays, structs and classes, nested as deep as you wish. Depending upon who asks the question, a non-primitive data structure may be just a structured type (array, struct, class), or a structured type containing structured types.

Related questions

What are different data type in c?

primitive non primitive


What is different between primitive date type and non primitive data type in c plus plus programming language?

A primitive data type is built into the language - int, char, long, etc. A non-primitive data type is am abstract data type that is built out of primitive data types - linked list, queue, stack, etc.


What do you mean by non primitive data structure in C programming?

What do you mean by searching in data structure in C.?


Why c plus plus called as paritial oop?

C++ is only partially OOP because it is a superset of C and, for the sake of backward compatibility, retains the concept of primitive data types (such as integrals like char and int) and pointer data types, which are all strictly non-object-oriented. In Java and C#, there is no concept of a primitive data type. Even integral types such as int are treated as objects and there is no concept of a pointer data type.


Why is class called non primitive in c plus plus?

Primitive refers to base types, like int and char. Classes are complex types, combining primitives with other classes or structures, and are therefore non-primitive.


What is primary data type in C?

The terms "primary data type" and "secondary data type" are not exactly correct when working in C. Instead, C has what are called "primitive data types" or, in some references, "basic types" - types which can be affected by arithmetic operators. Other data types include structs, arrays, and unions. Structs, arrays and unions cannot be affected as a whole by arithmetic operators, although the members within that are primitive data types can be. Pointers can technically be affected by arithmetic operators, particularly +, -, ++ and --, but because their values are expected to be used as addresses, they're not considered to be primitive in nature. There are three primitive data types in C: integers, real numbers and complex numbers. Integers have no decimal points and can be signed or unsigned, and real and complex numbers are signed and have decimal points. Boolean types are represented by integers, most commonly "int" under Posix-style systems. More information about primitive data types can be found in the related links below


Is string arr a non primitive data type?

Depends on the context of the question you were asking from, there are 2 distinct answers: Yes and NO. In the narrowest definition, any array is NOT a primitive data type in C#. Hence a string array is NOT a primitive data type in that context. A string itself, however, is a primitive data type. Some developers would like to extend the definition of "primitives" into the arrays, collections, and Enumeration. Thus, in this context, an array of string IS a primitive data type.


Why Boolean is not considered in C as primitive data type?

primitive data types are those which are independent and boolean expression is never independent it's existence always depends on some conditions or voltage signals


What is non primitive data types in Java?

"Primitive" data types are integers (char, int, long), floats (float, double) and void. Void is never used for variables, but tells C that a function accepts and/or returns no arguments. "Non-primitive" data types include arrays, structs and classes. These utilize primitive data types and are called, in general, structured data types. Data types can become more complicated as you mix the structured data types. For instance, arrays, structs and classes can contain arrays, structs and classes, nested as deep as you wish. Depending upon who asks the question, a non-primitive data structure may be just a structured type (array, struct, class), or a structured type containing structured types.


Which language is 100 percent pure object oriented language?

The languages C# and Ruby are notable for their pure object oriented design. You can even call instance functions on literals, such as 10.to_s (Ruby) or 10.ToString() (C#). Other object-oriented designs tend to treat primitives as non-objects, such as in Java, and are therefore not technically "100%" object-oriented.


Explain the basic datatypes in C?

C datatype can be categories into two part 1) Scalar data type 2) derived data type.. The scalar data type is also called basic data type they are int char float double long signed or unsigned are key word which effectively change the storing power of these data type. by default they are signed in nature..


What is the difference between class data type and basic type in c plus plus .How can someone know which one is class type and which one is basic type.?

Basic types (primitive data types) have no methods associated with them.