aspose file tools*
The moose likes Java in General and the fly likes What is the logic behind calls like JOptionPane.method() Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Java » Java in General
Bookmark "What is the logic behind calls like JOptionPane.method()" Watch "What is the logic behind calls like JOptionPane.method()" New topic
Author

What is the logic behind calls like JOptionPane.method()

Raghavan Chockalingam
Ranch Hand

Joined: Dec 20, 2005
Posts: 77
Forgive me on the title...here is the problem...
1. I need a clarification on what is the logic behind making calls like
JOptionPane.showMessageDialog();
Integer.parseInt();
We do not create objects for these variables and we call the methods of the classes directly...how this is possible...are they any special kind of classes???

2. I have not seen this kind of coding in any other language,,,can anyone explain me how this coding construct works???


Raghavan
SCJP 6
Ken Blair
Ranch Hand

Joined: Jul 15, 2003
Posts: 1078
They are static methods.
Ilja Preuss
author
Sheriff

Joined: Jul 11, 2001
Posts: 14112
And regarding your second question, you should read about "anonymous inner classes".


The soul is dyed the color of its thoughts. Think only on those things that are in line with your principles and can bear the light of day. The content of your character is your choice. Day by day, what you do is who you become. Your integrity is your destiny - it is the light that guides your way. - Heraclitus
Nick George
Ranch Hand

Joined: Apr 04, 2004
Posts: 815
to elaborate on 1: The static method creates its own frame, from which it gets input, and then returns that input. You never talk directly to the frame object
[ December 30, 2005: Message edited by: Nick George ]

I've heard it takes forever to grow a woman from the ground
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: What is the logic behind calls like JOptionPane.method()
 
Similar Threads
Friendly advice appreciated with a small personal project (Beginner)
Which statements in Java cannot be labelled?
CVS Plugin For Eclipse some times problematic : Why??
Throw - what's the point??
quick question about defining variables