Musarath
Answered On : Jun 24th, 2006
The primitive datatypes are nothing but the basic data types..like int,char,float,double etc..Char is a datatype which stores 2 bits of data..String has been derived from Char which takes more number of Char and integers..providing the more memory storage...Its not a primitive coz it is a basic datatype...Its advancement of char..So its not a primitive datatype
Login to rate this answer.
then how double is a primitive data type
its also derived for float so
pls clarify
Login to rate this answer.
bhargavi
Answered On : Jun 27th, 2006
As balaji has asked a nice question that " why double is a primitive data type as it came from float?" As double is the default data type given to the floating point-numbers.Naturally when we declare float f =0;---------the memory occupied to it is double.Inorder to use memory effectively,we go for float as float f=0.0f;As double is not a two float.
Login to rate this answer.
Guest
Answered On : Jun 29th, 2006
There are two types of datatype 1. primitive 2. Object
I think String can also be primitive and Object type.
If u write String a = "rabbi"; then the String will be used as primitive datatype.
But If u write String a = new String("rabbi"); then String will be used by Object datatype.
Login to rate this answer.
Suri
Answered On : Jul 1st, 2006
I think both:
String a= "abc"; and String a = new String("abc");
are the same.
Login to rate this answer.
You r right Suri
Strings are immutable , so
String a = "abc";
is same as
String a = new String("abc");
Login to rate this answer.
yes u r right suri
thank u
Login to rate this answer.
Ananth Murthy
Answered On : Jul 4th, 2006
Float and double both occupy fixed amount of memory irrespective of what number it holds. But String is an object. Memory allocation depends on the content

1 User has rated as useful.
Login to rate this answer.
ok thanks
Login to rate this answer.
Amit
Answered On : Jul 18th, 2006
The Main reason behind is that when we talk about primitive data type
Lets say for ex int i=5 , it means in memory where we have i , if we will access the contents there we will get the value 5.
But in case of a String , when we say
String s="abe";
when we try to access the contents of s we get the address where we have "abc".

1 User has rated as useful.
Login to rate this answer.
sravani
Answered On : Jul 26th, 2006
String is a predefined class and it is not a data type
Login to rate this answer.
balaji
Answered On : Jul 26th, 2006
hi ..
thank for ur reply
now its clear
bye
keep smiling and mailing
Login to rate this answer.
String is not a primitive data type becoz string is a class . Java programmers made it class in java application as java.lang package.
Login to rate this answer.
String is not a primitive data type.It is a wraper class which wraps up type called char.
Login to rate this answer.