• 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

Need clarification on objects?

 
Greenhorn
Posts: 5
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Hi,
I am new to JAVA. I am reading "CoreJava" book. I ran into couple of the following statments in different programs. If you know, Could you explain it?
Toolkit tj = Toolkit.getDefaultToolkit() (Page # 273)
Here is ToolKit is abstract class. I do not understand the right side part of = sign. I assume tj object is being made. I know abstract classes can not be instantiated.
Same thing here too: Container contentPane = frame.getContentPane() // here frame is a class.
Thanks,
sk
 
Ranch Hand
Posts: 396
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Hi k,
1)Toolkit tj = Toolkit.getDefaultToolkit() (Page # 273)
getDefaultToolkit() is a static function of Toolkit class.It returns an Object that extends the abstract Toolkit class.

2) Container contentPane = frame.getContentPane();
similarly getContentPane() function returns a container where we actually add our components.
regards
deekasha
 
k
Greenhorn
Posts: 5
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Thanks for your help
-sk
 
Consider Paul's rocket mass heater.
reply
    Bookmark Topic Watch Topic
  • New Topic