hi,jabber.I have a question about abstract class of java?

oldsix (oldsix)
in java, the abstract class can not new an object.So can i use the abstract method in the abstract class?which way?
the next code is run well,why?

eg. Toolkit ttkk=Toolkit.getDefaultToolkit();
Image img1=ttkk.getImage("abc.gif");

in this code, getImage() is the abstract method. It seems that you can use the abstract method directly. other more, what is the role of the ttkk? certainly,it isn't the object.
in documents of java, it seems the object of the subclass of Toolkit. is it right?

above all.there are two way to explain the code:
1. you can use the abstract method of abstract class.
2.from the static method getDefaultToolkit, you got the subobject of the Toolkit?
jabber,which one is right?
(#8383@0)
2000-9-11 -05:00

回到话题: hi,jabber.I have a question about abstract class of java?

回到论坛: HOME枫下论坛枫下论坛主坛工作学习IT技术讨论

URL:   
http://www.rolia.net/zh/post.php?f=0&p=8383