• 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:
  • Tim Cooke
  • Campbell Ritchie
  • Ron McLeod
  • Liutauras Vilda
  • Jeanne Boyarsky
Sheriffs:
  • Junilu Lacar
  • Rob Spoor
  • Paul Clapham
Saloon Keepers:
  • Tim Holloway
  • Tim Moores
  • Jesse Silverman
  • Stephan van Hulst
  • Carey Brown
Bartenders:
  • Al Hobbs
  • Piet Souris
  • Frits Walraven

A simple class

 
Ranch Hand
Posts: 60
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
I have a question:

A simple class:



If I run this from command prompt can someone tell me how many classes are loaded before this class is run? We can consider JDK 1.4 and also JDK 1.5.

Thanks in advance.
 
Java Cowboy
Posts: 16084
88
Android Scala IntelliJ IDE Spring Java
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator

C Shinde wrote:If I run this from command prompt can someone tell me how many classes are loaded before this class is run? We can consider JDK 1.4 and also JDK 1.5.


That's very hard to say, there is no simple way to find this out. To find out, try running the program with a profiler, which might be able to show you this information. JDK 1.5 contained a simple profiling tool, JConsole, and JDK 1.6 contains a more sophisticated tool, JVisualVM.
 
Marshal
Posts: 74711
335
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Not a "beginning" question. Moving thread.
 
Ranch Hand
Posts: 483
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Wont debugging in Eclipse give a rough idea?
 
Campbell Ritchie
Marshal
Posts: 74711
335
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator

Somnath Mallick wrote:Wont debugging in Eclipse give a rough idea?

No

Jesper's advice about JConsole will help.
 
Sheriff
Posts: 22573
122
Eclipse IDE Spring VI Editor Chrome Java Windows
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Or simply run "java -verbose Main".
 
C Shinde
Ranch Hand
Posts: 60
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Rob,

As you said I tried and it gave me a list of classes as being loaded.
The packages that the class belonged to were, java.land, java.io,sun.reflect,java.util,java.security, sun.misc....and lots more...
I understand some of them are the default packages and so they are loaded.

Thanks for the help.


 
Campbell Ritchie
Marshal
Posts: 74711
335
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
I never knew about -verbose
 
WHAT is your favorite color? Blue, no yellow, ahhhhhhh! Tiny ad:
Building a Better World in your Backyard by Paul Wheaton and Shawn Klassen-Koop
https://coderanch.com/wiki/718759/books/Building-World-Backyard-Paul-Wheaton
reply
    Bookmark Topic Watch Topic
  • New Topic