answersLogoWhite

0


Best Answer

String - is primitive data type

string - is user defined data type

User Avatar

Wiki User

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

Wiki User

12y ago

it is primitive type in java

This answer is:
User Avatar

Add your answer:

Earn +20 pts
Q: Is string is primitive or user defined data type?
Write your answer...
Submit
Still have questions?
magnify glass
imp
Continue Learning about Engineering

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];


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.


Application of array in data structure?

That rather depends on the underlying type. For any given type T, an array of type T is user-defined if T is user-defined, otherwise it is built-in. For example: #include<string> // required to use std::string std::string s[42]; // user-defined array int i[42]; // built-in array Here, s is a user-defined array because std::string is a user-defined type, whereas i is a built-in array because int is a built-in type.


Why arrays are not primitive data type?

An array is a primitive data type. It is the element type that may or may not be 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.

Related questions

Where string is primitive data type of string data type?

String is not primitive data. Only char,int,double,and boolean are!


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];


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.


Application of array in data structure?

That rather depends on the underlying type. For any given type T, an array of type T is user-defined if T is user-defined, otherwise it is built-in. For example: #include<string> // required to use std::string std::string s[42]; // user-defined array int i[42]; // built-in array Here, s is a user-defined array because std::string is a user-defined type, whereas i is a built-in array because int is a built-in type.


Why arrays are not primitive data type?

An array is a primitive data type. It is the element type that may or may not be 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.


Is it possible to convert strings in java to double directly?

Not directly. A String is an object, and a double is a primitive data type. To do the conversion you must first convert the String to a Double object (note the capital D in double), then convert that object to a double data type (lowercase d in double). Double is an object, double is a primitive data type. Here's a class that will convert a String to a double:public class StringToDouble{public static void main (String[] arguments) {String s = "100.00";double d = Double.valueOf(s.trim()).doubleValue();System.out.println("double d = " + d);}}


What are different data type in c?

primitive non primitive


What are the Difference between primitive data types and wrapper classes?

A primitive type is, in a way, built-in, in the language. This often includes different kinds of numbers, strings, and in some languages, dates and boolean. The other data type, other than primitive, is a compound, or user-defined, data type. For example, some languages allow the programmer to define compound data types, called a "struct" in C, or a "record" in Pascal, where the programmer can define (for example) a data of type point, consisting of x, y, and z coordinates. In object-oriented languages, these user-defined types are often defined as classes.A primitive type is, in a way, built-in, in the language. This often includes different kinds of numbers, strings, and in some languages, dates and boolean. The other data type, other than primitive, is a compound, or user-defined, data type. For example, some languages allow the programmer to define compound data types, called a "struct" in C, or a "record" in Pascal, where the programmer can define (for example) a data of type point, consisting of x, y, and z coordinates. In object-oriented languages, these user-defined types are often defined as classes.A primitive type is, in a way, built-in, in the language. This often includes different kinds of numbers, strings, and in some languages, dates and boolean. The other data type, other than primitive, is a compound, or user-defined, data type. For example, some languages allow the programmer to define compound data types, called a "struct" in C, or a "record" in Pascal, where the programmer can define (for example) a data of type point, consisting of x, y, and z coordinates. In object-oriented languages, these user-defined types are often defined as classes.A primitive type is, in a way, built-in, in the language. This often includes different kinds of numbers, strings, and in some languages, dates and boolean. The other data type, other than primitive, is a compound, or user-defined, data type. For example, some languages allow the programmer to define compound data types, called a "struct" in C, or a "record" in Pascal, where the programmer can define (for example) a data of type point, consisting of x, y, and z coordinates. In object-oriented languages, these user-defined types are often defined as classes.


Is string is a primitive type or not?

, Strings are not a primitive data type and strings are objects of class String. They have been built this way primarily because a large number of methods can be implemented for use if string is a class. That way coding regarding strings is much easier. If you really want to implement it as a primitive data type, go ahead and create an array of characters. but then you wont be able to utilize all the string related methods in JDK Regards, Prime


Difference between built in data type and user-defined datatype?

A built in data type is a framework's native data type. By default you'd probably have some built in generic data types, such as integer, string, boolean and so on. In the other hand sometimes you can extend the framework's data types, by programminga user-defined data type. In this data type you have to define it's behaviour and structure, and once defined, you can use it the same way you use the default data types. In PostgreSQL or Oracle, you can define data types. You can read about it on their webs.


Non primitive data type?

Struct or array.