Question :It is valid to declare an inherited method as abstract? (CoreJava)
Answer :Yes its valid to declare an inherited method abstract. But it would be of
no use as you need to define the class
abstract again.
e.g.
abstract class AbsTest
{
abstract void setName(String name);
}
public class AbsTest1 extends AbsTest //compile error is thrown as there is
an abstract method, declare the class abstract
{
abstract void setName(String name){} // error, abstract method
cannot have body
}
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.
Thursday, March 12, 2009
It is valid to declare an inherited method as abstract (CoreJava)
Subscribe to:
Post Comments (Atom)
No comments:
Post a Comment