This week's book giveaway is in the OO, Patterns, UML and Refactoring forum.
We're giving away four copies of Refactoring for Software Design Smells: Managing Technical Debt and have Girish Suryanarayana, Ganesh Samarthyam & Tushar Sharma on-line!
See this thread for details.
The moose likes Beginning Java and the fly likes problem with the same data type and class Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


JavaRanch » Java Forums » Java » Beginning Java
Bookmark "problem with the same data type and class" Watch "problem with the same data type and class" New topic
Author

problem with the same data type and class

harsh garg
Ranch Hand

Joined: Jul 13, 2008
Posts: 33
why String (data type and class) of java have the same name?no other data type like this in java?
Ankit Garg
Sheriff

Joined: Aug 03, 2008
Posts: 9400
    
  20

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");


SCJP 6 | SCWCD 5 | Javaranch SCJP FAQ | SCWCD Links
 
I’ve looked at a lot of different solutions, and in my humble opinion Aspose is the way to go. Here’s the link: http://aspose.com
 
subject: problem with the same data type and class
 
It's not a secret anymore!