views:

104

answers:

2

Possible Duplicate:
Interface vs Base class

A class implementing an interface has to implement all the methods of the interface, but if that class is implementing an abstract class is it necessary to implement all abstract methods?
If not, can we create the object of that class which is implementing the Abstract class???

+1  A: 

If you implement an abstract class and don't implement all the abstract methods, that class also has to be declared abstract, and therefore cannot be instantiated.

For example:

public abstract class A {

  public abstract method1();

}

public abstract class B extends A {

}

In the above example you would not be able to call new B();

Scobal
+1  A: 

If a class inherits an abstract class, it either has to implement all abstract members, or it has to be abstract too.

So, if the class doesn't implement all members, you can't create an instance of it.

Guffa