What is an interface?

Interface is a reference type which consists of only method declarations and constants.

All methods in interface by default public abstract and all fields are public static final eventhough it has not been mentioned explicitly.

Example:

public interface Car
{
int wheel=4;
int paintCar(String color);
int driveCar();
}

Comments

  1. nice example .. thanks a lot

    ReplyDelete
  2. Enter some more oops concepts related real time examples.

    ReplyDelete

Post a Comment

Popular posts from this blog

OOPS Concepts with realtime examples

Asynchronous Messaging