This week's book giveaway is in the Jython/Python forum.
We're giving away four copies of Murach's Python Programming and have Michael Urban and Joel Murach on-line!
See this thread for details.
Win a copy of Murach's Python Programming this week in the Jython/Python forum!
  • Post Reply Bookmark Topic Watch Topic
  • New Topic

problem with the same data type and class  RSS feed

 
harsh garg
Ranch Hand
Posts: 33
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
why String (data type and class) of java have the same name?no other data type like this in java?
 
Ankit Garg
Sheriff
Posts: 9608
36
Android Google Web Toolkit Hibernate IntelliJ IDE Java Spring
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
String is not a datatype. It's just a class. It just have some special treatment by the compiler because of which you can write this

String s = "Hello World";

The compiler internally converts this into

String s = new String("Hello World");
 
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!