• 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
  • paul wheaton
  • Ron McLeod
  • Devaka Cooray
Sheriffs:
  • Jeanne Boyarsky
  • Liutauras Vilda
  • Paul Clapham
Saloon Keepers:
  • Tim Holloway
  • Carey Brown
  • Piet Souris
Bartenders:

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

 
Ranch Hand
Posts: 77
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
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???
 
Ranch Hand
Posts: 1078
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
They are static methods.
 
author
Posts: 14112
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
And regarding your second question, you should read about "anonymous inner classes".
 
Ranch Hand
Posts: 815
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
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 ]
 
reply
    Bookmark Topic Watch Topic
  • New Topic