0% found this document useful (0 votes)
177 views4 pages

Interview Questions On Interface in Java - JAVA95

interface
Copyright
© © All Rights Reserved
Available Formats
Download as PDF, TXT or read online on Scribd
Download as pdf or txt
0% found this document useful (0 votes)
177 views4 pages

Interview Questions On Interface in Java - JAVA95

interface
Copyright
© © All Rights Reserved
Available Formats
Download as PDF, TXT or read online on Scribd
Download as pdf or txt
Download as pdf or txt
You are on page 1/ 4

9/28/2017 Interview Questions on Interface in Java ~ JAVA95

Follow Us On
CORE JAVA EXCEPTION HANDLING MULTITHREADING COLLECTION ARRAY STRING PROGRAMS

JAVA95
Let's learn java programming language with easy steps

HOME ABOUT US CONTACT US DISCLAIMER PRIVACY POLICY

Home JAVA INTERVIEW QUESTIONS & ANSWERS Interview Questions on Interface in Java Search

Interview Questions on Interface in Java FACEBOOK PAGE LIKES


ByAnurag Singh 23:04 1 comment:

Javatutorial95
852 likes
Java Interface Interview Questions and Answers

Like Page Learn More

Be the first of your friends to like this

FOLLOW JAVATUTORIAL95 ON GOOGLE+

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.
JavaTutorial95
Now start here in detail java interface questions and answers.
Follow

15 followers

(1) What is interface in java?


Java interface is a blueprint of a class and it is used to achieve fully abstraction and FOLLOW JAVATUTORIAL95 ON TWITTER
it is a collection of abstract methods.
Follow @javatutoria95

(2) Can we achieve multiple inheritance by using


POPULAR POSTS
interface?
Yes, we can achieve multiple inheritance through the interface in java but it is not Top 10 Java Programming Interview
Questions and Answers
possible through class because java doesn't support multiple inheritance through
Java Programming Interview
class. Questions Now, Here we will discuss
some basic java programming
interview questions and answers
(3) How to declare an interface, write a syntax? which a...
Interview Questions on Interface in
The syntax of declaring the interface in java by using interface keyword :
Java
Java Interface Interview Questions
interface FirstInterface and Answers Here we are going to
cover all the top most interview
{ questions on interface in jav...
fields;
Interview Questions on String in Java
methods; String Interview Questions in Java This post is all
} about of interview questions on String in java . Here
we will cover all the ja...
https://javatutorial95.blogspot.in/2017/08/interview-questions-on-interface-in-java.html 1/4
9/28/2017 Interview Questions on Interface in Java ~ JAVA95
we will cover all the ja...

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


No, we cannot create an object of interface.

String Programming Interview


Questions in Java
(5) Can we declare the interface as final? String Programming Interview
Questions Here we are gonna to
No, we can't declare the interface as final because the implementation of the discuss some string programming
interview questions in java. String
interface is provided by another class. If we make the interface as final, it will ha...
throw a compile-time error.
Difference Between class and
interface in java
(6) Which keyword java compiler add before interface Class vs Interface in Java In the last
post we have already discussed what
fields and methods? is the difference between abstract
class and interface ...
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,
LABELS
all the fields are public, static and final and all the methods are public and abstract
by default in an interface. ARRAY (2)

COLLECTION (21)

CORE JAVA (56)


(7) Does interface extend Object class by default?
EXCEPTION HANDLING (6)
No, Interface does not extend Object class in java by default but all the classes
JAVA INTERVIEW QUESTIONS & ANSWERS (11)
extend Object class by default.
JAVA NUMBER CONVERSION (2)

(8) Can an interface extend another interface? Java Number Pattern Programs (1)

JAVA SE PROGRAMMING INTERVIEW QUESTIONS


Yes, an interface can extend another interface. AND ANSWERS (4)

JAVA STAR PATTERN PROGRAMS (1)

MULTITHREADING (6)
(9) Can an interface extend a class? PROGRAMS (9)

No, A class can implement an interface but interface cannot extend a class. SERVLET (1)

STRING (7)

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

No, we cannot put static methods in interfaces because all the methods are by 2017 (114)
default public and abstract in the interface and we cannot use abstract and static September (14)

keywords together. August (18)


Interview Questions on Final Keyword in Java
Difference Between HashSet and HashMap in
Java
(11) Can we declare an interface with the abstract
keyword? Interview Questions on Exception Handling in
Java
Yes, we can declare abstract keyword with interfaces but there is no need to write Interview Questions on String in Java
abstract keyword with interfaces because all the interfaces are abstract by default. Interview Questions on Interface in Java
Difference Between HashMap and Hashtable
Interview Questions on Constructor in Java
(12) What is default keyword in an interface? OOPS Concepts in Java Interview Questions

By the help of default keyword, we can keep non-abstract method in java interface Java Programs Using Final Keyword
i.e with method body{}. This is the new feature of JAVA 8. Star Pattern Programs In Java
Serialization In Java
Syntax of default keyword : What is Servlet In Java
Difference Between String and StringBuffer
interface Test
Number Pattern Programs In Java

https://javatutorial95.blogspot.in/2017/08/interview-questions-on-interface-in-java.html 2/4
9/28/2017 Interview Questions on Interface in Java ~ JAVA95

{ Difference Between ArrayList and LinkedList

default void show() Difference Between Array and Collection In


Java
{
----- Java Re ection

----- Call By Value and Call By Reference In Java

}
July (18)
}
June (18)
May (10)
(13) What is marker or tagged interface?
April (12)
Marker interface is an interface that has no data member and method like March (13)
Serializable, Cloneable, etc. February (4)
January (7)

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

No.
TRANSLATE

(15) After compilation of interface program, .class file


will be generated for every interface in java... true or Select Language

false.? Powered by Translate

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?


There are many differences 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.

interface
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.

Like 62 Share

Share:

Newer Post Home Older Post

1 comment:

Zahia Nagah 28 August 2017 at 11:43

https://javatutorial95.blogspot.in/2017/08/interview-questions-on-interface-in-java.html 3/4
9/28/2017 Interview Questions on Interface in Java ~ JAVA95
Good Job, it's more useful
thanks :) :)
Reply

Enter your comment...

Comment as: Educate Yourself (Google) Sign out

Publish Preview Notify me

Copyright 2017 JAVA95 | Powered by Blogger

Design by FlexiThemes | Blogger Theme by Lasantha - PremiumBloggerTemplates.com | Rapid Domain Search

https://javatutorial95.blogspot.in/2017/08/interview-questions-on-interface-in-java.html 4/4

You might also like