Abstract keyword

Abstract Class : Must be Extended

Abstract Method : Must be Overridden

an abstract method has no body.

We can’t have an abstract method in a non abstract class

Abstract class can have both abstract and non abstract method
We must implement the abstract method means we should provide a body for method

Interface : 100% abstract class

A variable declared in an interface is always implicit final;

interface foo{

int x = new int

}

Advertisements
This entry was posted in java and tagged . Bookmark the permalink.

Leave a Reply

Please log in using one of these methods to post your comment:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s