Question :What does it mean that a method or class is abstract? (CoreJava)
Answer :An abstract class cannot be instantiated. Only its subclasses can be
instantiated. You indicate that a class is abstract with the abstract keyword
like this:
public abstract class Container extends Component {
Abstract classes may contain abstract methods. A method declared
abstract is not actually implemented in the current class. It exists only to
be overridden in subclasses. It has no body. For example,
public abstract float price();
Abstract methods may only be included in abstract classes. However, an
abstract class is not required to have any abstract methods, though most
of them do.
Each subclass of an abstract class must override the abstract methods of
its superclasses or itself be declared abstract.
www.interviewhelper.org is a hope for all the Job seekers. Users can find unlimited here. These range from technical to HR, from functional to behavioral. www.interviewhelper.org contains in the fields like Ajax,VB,Networking,Sharepoint,JEE,Perl,Javascript,Bioinformatics,Classic ASP,Unix,Linux,Accounting,Oracle DBA,Microprocessor,Bluetooth,jms,jme,.net framework,ABAP,ASP,ASP.net,Basic .net Framework,Interview Questions,C language,C++,database,Oracle,Java,PHP,LAMP,SAP etc.
Tuesday, March 10, 2009
What does it mean that a method or class is abstract? (CoreJava)
Subscribe to:
Post Comments (Atom)
No comments:
Post a Comment