perbezaan antara abstract class dan interface class dalam java



abstract ClassesInterfaces
abstract class can extend only one class or one abstract class at a time  interface can extend any number of interfaces at a time
abstract  class  can extend from a class or from an abstract class  interface can extend only from an interface
abstract  class  can  have  both  abstract and concrete methods interface can  have only abstract methods
 A class can extend only one abstract classA class can implement any number of interfaces
In abstract class keyword ‘abstract’ is mandatory to declare a method as an abstract In an interface keyword ‘abstract’ is optional to declare a method as an abstract
abstract  class can have  protected , public and public abstract methods Interface can have only public abstract methods i.e. by default
abstract class can have  static, final  or static final  variable with any access specifier interface  can  have only static final (constant) variable i.e. by default


http://beginnersbook.com/2013/05/abstract-class-vs-interface-in-java/

Comments

Post a Comment

Popular posts from this blog

Lab Network 2024

Step to publish your static html web page to GitHub

Tutorial OOP(reversion java)