• Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

regarding class definition

 
ronak mehta
Greenhorn
Posts: 23
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
1) Which of the following is an abstract class
public abstract abc( );
public abstract void ABC( );
public abstract ABC( ) { };
 
Bhaskar Selvaraju
Greenhorn
Posts: 29
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
public abstract abc( );
public abstract void ABC( );
public abstract ABC( ) { };
None of these are abstract classes. an abstract class looks like this
abstract class Abs{
public void abmeth();
public void normalmeth(){
System.out.prinltn("I am a normal method");
}
}
Just a basic one
 
ronak mehta
Greenhorn
Posts: 23
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
u are right. but they give the second one. public abstract void ABC() is abstract class. really it is not right?
 
swati bannore
Ranch Hand
Posts: 201
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Bhaskar,
U need to define method "public void abmeth();" as abstract or else compiler will give u error asking u to define a method body or declare it as abstract..
thx
[This message has been edited by swati bannore (edited August 18, 2001).]
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic