• Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

Need clarification on objects?

 
k
Greenhorn
Posts: 5
  • Mark post as helpful
  • send pies
  • 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
 
deekasha gunwant
Ranch Hand
Posts: 396
  • Mark post as helpful
  • send pies
  • 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
  • Quote
  • Report post to moderator
Thanks for your help
-sk
 
Consider Paul's rocket mass heater.
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic