File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
The moose likes Beginning Java and the fly likes Need clarification on objects? Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Java » Beginning Java
Bookmark "Need clarification on objects?" Watch "Need clarification on objects?" New topic

Need clarification on objects?


Joined: Aug 28, 2000
Posts: 5
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.
deekasha gunwant
Ranch Hand

Joined: May 06, 2000
Posts: 396
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.

Joined: Aug 28, 2000
Posts: 5
Thanks for your help
I agree. Here's the link:
subject: Need clarification on objects?
It's not a secret anymore!