This week's book giveaways are in the Refactoring and Agile forums.
We're giving away four copies each of Re-engineering Legacy Software and Docker in Action and have the authors on-line!
See this thread and this one for details.
Win a copy of Re-engineering Legacy Software this week in the Refactoring forum
or Docker in Action in the Cloud/Virtualization forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

Singleton class, class loader, string literals

 
Agarwal Priyanka
Greenhorn
Posts: 20
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
hello......

can any body give me the proper definition of singleton class, class loader, string literals.
 
arulk pillai
Author
Ranch Hand
Posts: 3385
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
A singleton is a single instance of a class per JVM per class loader. Please google for Java singleton design pattern for example.

Classes are introduced into the Java environment when they are referenced by name in a class that is already running. There is a bit of magic that goes on to get the first class running (which is why you have to declare the main() method as static, taking a string array as an argument), but once that class is running, future attempts at loading classes are done by the class loader. from --> http://www.javaworld.com/javaworld/jw-10-1996/jw-10-indepth.html



String name = "Java" is a STring literal. All string literals in Java programs, are implemented as instances of String class. Strings in Java are 16-bit Unicode.
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic