public abstract class Canine { public Bark speak();}
Nik Arora
Ranch Hand
Joined: Apr 26, 2007
Posts: 652
posted
0
Hi Nikunj,
Originally posted by nikunj thakur: why is this not a compilable abstract class
public abstract class Canine { public Bark speak();}
An abstract class should have abstract methods and can have non-abstract method also.In your example the method is not abstract so you are getting the error.
Regards, Nik
Yogesh Baraskar
Ranch Hand
Joined: Oct 07, 2007
Posts: 33
posted
0
public abstract class Canine { public Bark speak();}
speak(); // the brackets and then semicolon suggests that it is an abstract method and you should declare it as public abstract Bark speak();
or else if you dont want to declare method as abstract then make it public Bark speak(){ }