answersLogoWhite

0


Best Answer

"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.

User Avatar

Wiki User

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

Wiki User

6y ago

When classifying data types we usually begin by referring to a language's fundamental types. In C++, for instance, we have the following fundamental types:

  • A Boolean type (bool)
  • Character types (such as char and wchar_t)
  • Integer types (such as int and long long)
  • Floating point types (such as double and long double)
  • A type to signify the absence of information (void)

A user can also construct other types using declarator operators:

  • Pointer types (such as int* and std::string*)
  • Array types (such as char[] and std::stack[])
  • Reference types (such as double& and std::vector&&)

In addition, a user can define their own types:

  • Data structures, classes and unions (such as std::vector and std::string)
  • Enumeration types for representing sets of values (enum and enum class types)

The Boolean, character and integer types are collectively called integral types. The integral and floating point types are collectively known as arithmetic types. Enumerations, classes, data structures and unions are collectively known as user-defined types because they must be defined by users rather than being available for use without previous declaration, the way fundamental types are. In contrast, fundamental types, pointers and references are collectively referred to as built-in types.

The integral and floating point types are provided in a variety of sizes to give programmers a choice of the amount of storage consumed, the precision, and the range available for computations. The assumption is that a computer provides bytes for holding characters, words for holding and computing integer values, some entity most suitable for floating point computation, and addresses for referring to these entities. The C++ fundamental types together with pointers and arrays present these machine-level notions to the programmer in a reasonably implementation-independent manner.

In contrast, user-defined types present high level abstractions which are not supported natively by the machine; the user must provide all code necessary to correctly handle these entities.

We often use the term primitive data type when referring to a data type used as the building block for a more complex, user-defined type. The primitive data type need not be a built-in type as there are many well-established user-defined types that can also be regarded as being primitive data structures, particularly those defined by the C++ standard template library (such as std::string, std::vector and std::list).

This answer is:
User Avatar

User Avatar

Wiki User

13y ago

A primitive variable can be one of eight types: char, boolean, byte, short, int, long, double, or float. Once a primitive has been declared, its primitive type can never change, although in most cases its value can change. they are used to store values like name, age, salary etc.

Anything that is not primitive is a "non primitive" data type.

This answer is:
User Avatar

User Avatar

Wiki User

12y ago

arrays is the non primitive data structure

This answer is:
User Avatar

User Avatar

Wiki User

8y ago

User-defined types are non-primitive types.

This answer is:
User Avatar

User Avatar

Wiki User

11y ago

That refers mainly to objects. This includes items that are internally stored as objects, even if you don't use the "new" operator - such as arrays and Strings.

This answer is:
User Avatar

Add your answer:

Earn +20 pts
Q: What is non primitive data types in Java?
Write your answer...
Submit
Still have questions?
magnify glass
imp
Continue Learning about Engineering

Variables as object in java?

There are two main categories of variables in Java. They are primitive and non primitive. Primitive data types are the basic data types like int, float, char etc. These are not objects. The other non primitive data types are all types of Java Objects. Example: String, ArrayList etc.


What are the types of non primitive in java?

There are 8 primitive data types: byte, short, int, long, float, double, boolean, charany other data type in Java can be considered non primitive data type.Ex: StringString data type can also be known as the primitive data type because it is already provided by the Java language, since it is not a data type but its a class, but as we know that we can use the classes as types for the variables/instance variables, as we use while creating an object of any class, hence the classes that we create and use them as a datatype are known as non-primitive datatype....for any query, mail me on engineer.sooraj@gmail.com or call me on +92-331-350-6956.....


Data types in c primitive and non primitive?

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


In java is A string the same thing as a char?

No.A char is a single Unicode character. It is stored as a primitive (i.e., non-object) data. A string can be considered as an array of chars - Java stores it as an object.No.A char is a single Unicode character. It is stored as a primitive (i.e., non-object) data. A string can be considered as an array of chars - Java stores it as an object.No.A char is a single Unicode character. It is stored as a primitive (i.e., non-object) data. A string can be considered as an array of chars - Java stores it as an object.No.A char is a single Unicode character. It is stored as a primitive (i.e., non-object) data. A string can be considered as an array of chars - Java stores it as an object.


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.

Related questions

Variables as object in java?

There are two main categories of variables in Java. They are primitive and non primitive. Primitive data types are the basic data types like int, float, char etc. These are not objects. The other non primitive data types are all types of Java Objects. Example: String, ArrayList etc.


What are the types of non primitive in java?

There are 8 primitive data types: byte, short, int, long, float, double, boolean, charany other data type in Java can be considered non primitive data type.Ex: StringString data type can also be known as the primitive data type because it is already provided by the Java language, since it is not a data type but its a class, but as we know that we can use the classes as types for the variables/instance variables, as we use while creating an object of any class, hence the classes that we create and use them as a datatype are known as non-primitive datatype....for any query, mail me on engineer.sooraj@gmail.com or call me on +92-331-350-6956.....


Data types in c primitive and non primitive?

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


In java is A string the same thing as a char?

No.A char is a single Unicode character. It is stored as a primitive (i.e., non-object) data. A string can be considered as an array of chars - Java stores it as an object.No.A char is a single Unicode character. It is stored as a primitive (i.e., non-object) data. A string can be considered as an array of chars - Java stores it as an object.No.A char is a single Unicode character. It is stored as a primitive (i.e., non-object) data. A string can be considered as an array of chars - Java stores it as an object.No.A char is a single Unicode character. It is stored as a primitive (i.e., non-object) data. A string can be considered as an array of chars - Java stores it as an object.


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 are the only types in Java that are not classes?

The non-class Java data types are primitives: * byte * short * int * long * float * double * boolean * char


What are different data type in c?

primitive non primitive


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.


Can you store non primitive data type in the array list?

Yes you can store non primitive data type variables in an array. String is a non primitive data type. You can declare a string array as: String a[]=new String[10];


What is the difference between primitive and non primitive data structure?

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.


Non primitive data type?

Struct or array.