If all the methods in abstract class are declared as
abstract then what is difference between abstract class and
in interface?

Answers were Sorted based on User's Feedback



If all the methods in abstract class are declared as abstract then what is difference between abst..

Answer / ravi

if all the methods are abstract in abstract class,then the
only difference left is,,,,

interface can have static and final variables with public
and abstract access modifier only ,,,while abstract class
can have any type of variable with any type of access
modifiers

Is This Answer Correct ?    30 Yes 3 No

If all the methods in abstract class are declared as abstract then what is difference between abst..

Answer / ravi sv

Multiple inheritance is possible only through interface,not
with abstract class. So if u have an interface we can go
implementing multiple interfaces rather than extending a
single abstract class.

Is This Answer Correct ?    15 Yes 1 No

If all the methods in abstract class are declared as abstract then what is difference between abst..

Answer / namita

In abstract class concrete methods are also there. concrete
methods are the one which has implementation. so in future
if any programmer wants to give concrete methods can use
abstract class not interface.
In abstract class for methods and variables
public,private,protected modifier can be use. but in
interface public and abstract are permitted.

Is This Answer Correct ?    18 Yes 6 No

If all the methods in abstract class are declared as abstract then what is difference between abst..

Answer / sumit jain

i am not agree with the answer provided by prasad bhagwat
as already mention inthe question that all the method of
abtract class are declared as abstract and as per rules of
abstract class impletation you need to provide
implemenation of all abstract methods present in abstract
class unitl & unlesss you declared child class also as an
abstract class.

Is This Answer Correct ?    9 Yes 2 No

If all the methods in abstract class are declared as abstract then what is difference between abst..

Answer / ashok kumar

Methods in the abstract class can be accessed only through
a class hierarchy i.e through inheritance.

But methods in the interface can be accessed anywhere i.e
across the class hierarchy.(without inheritance).

Is This Answer Correct ?    7 Yes 7 No

If all the methods in abstract class are declared as abstract then what is difference between abst..

Answer / pravin

If you are making methods as abstract other restictions of
and difference is as it is like about modifiers[private, final, transient, volatile]

when condition is like your class extends other class [like JFrame or any such condition]then you cant use abstract class you must go to the interfaces.

Is This Answer Correct ?    0 Yes 0 No

If all the methods in abstract class are declared as abstract then what is difference between abst..

Answer / sachin more

All others are just giving the descriptn of Abstract and Interface Classes, the exact and simple answer is given by Prasad Bhagvat. Sorry Sumit, But u r confused betwn Abstract and Interface classes, u r saying the exact opposite

Is This Answer Correct ?    0 Yes 3 No

If all the methods in abstract class are declared as abstract then what is difference between abst..

Answer / prasad bhagwat

You can inherit the abstract class and use only those
methids which you want.

But in Interface you have you implement every method.

Is This Answer Correct ?    7 Yes 18 No

Post New Answer

More Core Java Interview Questions

What does string intern() method do?

1 Answers  


How do you reverse sort a list in java?

1 Answers  


Give us a program to check for parenthesis matching using stack.

1 Answers   Genpact,


How many types of design patterns are there?

1 Answers  


What is an iterator java?

1 Answers  


Can a class be a super class and a sub-class at the same time? Give example.

2 Answers  


how to print output with out using sop statements

5 Answers   UHG,


Discuss different types of errors that generally occur while programming.

1 Answers   Amdocs,


Can a final variable be null?

1 Answers  


why java does not support multiple inheritance

41 Answers   Diamond, Euclid, Evergent, KLKJ, Mind Tree, NIIT, SSI Small Scale Industries, Wipro,


Which package is imported by default?

1 Answers  


what are the difference between Java and .Net?

5 Answers  


Categories