Interface Interview Questions in Java


Prev Tutorial Next Tutorial

Interview Questions on Interface in Java

.

What is Interface ?

An interface is a collection of abstract methods. A class implements an interface, thereby inheriting the abstract methods of the interface..

Main features of Interface ?

  • Interface cannot be instantiated
  • An interface does not contain any constructors
  • All of the methods in an interface are abstract

Can an Interface be final ?

No, because its implementation is provided by another class.

What is marker interface ?

An interface that have no data member and method is known as a marker interface.For example Serializable, Cloneable etc.

What is difference between abstract class and interface ?

An abstract class can have method body (non-abstract methods) but Interface have only abstract methods.

How to implement Interface in Java ?

Syntax

interface A
{
....
....
}
interface B
{
....
....
}
class C implements A,B
{
....
....
}

Prev Tutorial Next Tutorial

Google Advertisements
Download Projects

Google Adsense Advertisements

Buy 3 Year Old Domain, Tutorialday.com, SeosmoTools.com @$200

Buy This Ad Space @$50 per Month, Ad Size 300X250 Contact on: hitesh.xc@gmail.com WhatsApp no. 8882538826

Yahoo Advertisements