File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
http://aspose.com/file-tools
The moose likes Java in General and the fly likes A simple class Big Moose Saloon
  Search | Java FAQ | Recent Topics
Register / Login


JavaRanch » Java Forums » Java » Java in General
Reply Bookmark "A simple class" Watch "A simple class" New topic
Author

A simple class

C Shinde
Ranch Hand

Joined: Oct 22, 2009
Posts: 59
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.

This message was edited 2 times. Last update was at by Bear Bibeault



Regards,
Chetan Shinde
Jesper de Jong
Java Cowboy
Bartender

Joined: Aug 16, 2005
Posts: 11225

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.


Java Beginners FAQ - JavaRanch SCJP FAQ - The Java Tutorial - Java SE 7 API documentation
Scala Notes - My blog about Scala
Campbell Ritchie
Sheriff

Joined: Oct 13, 2005
Posts: 25060
Not a "beginning" question. Moving thread.
Somnath Mallick
Ranch Hand

Joined: Mar 04, 2009
Posts: 445
Wont debugging in Eclipse give a rough idea?
Campbell Ritchie
Sheriff

Joined: Oct 13, 2005
Posts: 25060
Somnath Mallick wrote:Wont debugging in Eclipse give a rough idea?
No

Jesper's advice about JConsole will help.

This message was edited 1 time. Last update was at by Campbell Ritchie

Rob Spoor
Saloon Keeper

Joined: Oct 27, 2005
Posts: 17259

Or simply run "java -verbose Main".


SCJP 1.4 - SCJP 6 - SCWCD 5
How To Ask Questions How To Answer Questions
C Shinde
Ranch Hand

Joined: Oct 22, 2009
Posts: 59
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
Sheriff

Joined: Oct 13, 2005
Posts: 25060
I never knew about -verbose
 
 
subject: A simple class
 
developer file tools

cast iron skillet 49er

more from paul wheaton's glorious empire of web junk: cast iron skillet diatomaceous earth rocket mass heater sepp holzer raised garden beds raising chickens lawn care CFL flea control missoula heat permaculture