Let's learn java programming language with easy steps. This Java tutorial provides you complete knowledge about java technology.

Thursday, 24 August 2017

Interview Questions on Interface in Java

Java Interface Interview Questions and Answers

Interview Questions on Interface in Java

Here we are going to cover all the top most interview questions on interface in java one by one. This article is very important for any java interview point of view.

Now start here in detail java interface questions and answers.

(1) What is interface in java?

Java interface is a blueprint of a class and it is used to achieve fully abstraction and it is a collection of abstract methods.

(2) Can we achieve multiple inheritance by using interface?

Yes, we can achieve multiple inheritance through the interface in java but it is not possible through class because java doesn't support multiple inheritance through class.

(3) How to declare an interface, write a syntax?

The syntax of declaring the interface in java by using interface keyword :

interface FirstInterface

(4) Can we create an object of an interface?

No, we cannot create an object of interface.

(5) Can we declare the interface as final?

No, we can't declare the interface as final because the implementation of the interface is provided by another class. If we make the interface as final, it will throw a compile-time error.

(6) Which keyword java compiler add before interface fields and methods?

In an interface, Java compiler adds public, static and final keywords before fields or data members and add public abstract keywords before methods. In other words, all the fields are public, static and final and all the methods are public and abstract by default in an interface.

(7) Does interface extend Object class by default?

No, Interface does not extend Object class in java by default but all the classes extend Object class by default.

(8) Can an interface extend another interface?

Yes, an interface can extend another interface.

(9) Can an interface extend a class?

No, A class can implement an interface but interface cannot extend a class.

(10) Can we put a static method in interfaces?

No, we cannot put static methods in interfaces because all the methods are by default public and abstract in the interface and we cannot use abstract and static keywords together.

(11) Can we declare an interface with the abstract keyword?

Yes, we can declare abstract keyword with interfaces but there is no need to write abstract keyword with interfaces because all the interfaces are abstract by default.

(12) What is default keyword in an interface?

By the help of default keyword, we can keep non-abstract method in java interface i.e with method body{}. This is the new feature of JAVA 8.

Syntax of default keyword :

interface Test
default void show()

(13) What is marker or tagged interface?

Marker interface is an interface that has no data member and method like Serializable, Cloneable, etc.

(14) Can we declare a constructor in the interface?


(15) After compilation of interface program, .class file will be generated for every interface in java... true or false.?

This is true.

(16) Can we change the value of a field in interface after initialization?

No, Because all the fields of the interface are by default final.

(17) Difference between abstract class and interface?

abstract class

  • Through abstract class, you cannot achieve multiple inheritance.
  • You can keep non-abstract method(with method body) in the abstract class.
  • In the abstract class, fields are not public, static, final and methods are not public abstract by default.

  • Through the interface, you can achieve multiple inheritance.
  • In an interface, you can't keep non-abstract method but since java 8 it is possible.
  • In an interface, fields are public, static, and final and methods are public and abstract by default.


Above we saw some most important Interview questions and answers on java interface which is mostly asked in core java interviews.


  1. Good Job, it's more useful
    thanks :) :)

    1. Great Article android based projects

      Java Training in Chennai

      Project Center in Chennai

      Java Training in Chennai

      projects for cse

      The Angular Training covers a wide range of topics including Components, Angular Directives, Angular Services, Pipes, security fundamentals, Routing, and Angular programmability. The new Angular TRaining will lay the foundation you need to specialise in Single Page Application developer. Angular Training

  2. The list of your blogs are very helpful for those who want to learn programming.Thanks for your post.
    Java training in chennai

  3. Great stuff and useful for job seekers!


  4. Nice site....Please refer this site also Our vision success!Training are focused on perfect improvement of technical skills for Freshers and working professional. Our Training classes are sure to help the trainee with COMPLETE PRACTICAL TRAINING and Real time methodologies
    Dot Net Course in Chennai | Best Dot Net Training Institute in Chennai
    Testing Courses in Chennai | Best Software Testing Training Institute in Chennai With Placement
    Java Training in Chennai | Core Java Training in Chennai | java course and certification
    PHP training in chennai | Best PHP Training in chennai

  5. Interface can contain static methods from java8

  6. All the interview questions are so helpful. Thank you for providing this detailed post. It is very helpful to me.

  7. great article about java interface interview questions and answers.

  8. Please update it. Interface can contain static methods. If you are declaring a static method in the interfaces and do not provide a body, it will give a compilation error . Something like "Method require a body instead of semicolon"

  9. This blog is so cool. I am learning Java Training online. This blogs helps me find out better understanding about salesforce training. Thank you for this blog!

  10. Thank you for sharing this amazing post. Looking forward to reading more.
    Visit us: Java Training
    Visit us: Java Course

  11. thank you for sharing this article. VISIT:Python Online Training

  12. Excellent information provided by you through this post. I follow all the mentioned information.If you are looking for Interview Questions and answers website then you can visit Just Crack Interview, here you will find interview questions and answers for developer, software engineer, bankers etc.


Facebook Page Likes

Follow javatutorial95 on twitter

Popular Posts