• Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Jeanne Boyarsky
  • Ron McLeod
  • Paul Clapham
  • Liutauras Vilda
Sheriffs:
  • paul wheaton
  • Rob Spoor
  • Devaka Cooray
Saloon Keepers:
  • Stephan van Hulst
  • Tim Holloway
  • Carey Brown
  • Frits Walraven
  • Tim Moores
Bartenders:
  • Mikalai Zaikin

ClassLoader Issue

 
Greenhorn
Posts: 26
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Hi every body, please help me..
How to determine Whether a class is loaded in the memory or not ?
without creating object of that class. let I have the following class


Thanks in advance...
 
Marshal
Posts: 79178
377
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
You are interfering with the loading process by creating instances, printing messages, etc. You cannot create instances, print messages, or anything. until after the class is loaded. This is what you are trying:-
“Is the class Foo loaded?”
“No.”
“Well load it and then see whether it is loaded.”
You can try a static initialiser which prints a message similar to “class loaded”, but that is not necessarily accurate. To find whether such a technique is accurate, you would have to read the Java Language Specification, which tells you when classes are loaded.
 
reply
    Bookmark Topic Watch Topic
  • New Topic