I have a class which is abstract which contains only the
abstract methods. This is similar to an interface. Then, if
i have given a choice to choose one of them. Which one i
have to choose and why?

Answers were Sorted based on User's Feedback



I have a class which is abstract which contains only the abstract methods. This is similar to an in..

Answer / venu

i preferred to choose interface bcoz
if i implement interface still i have a chance to extend
another class

Is This Answer Correct ?    5 Yes 0 No

I have a class which is abstract which contains only the abstract methods. This is similar to an in..

Answer / harikrishna

you never get a chance to choose a method from abstract
class,because if you are writing a abstract class you
have to provide implementation to all the methods in
subclass otherwise you should declare that subclass as
Abstractclass.

Is This Answer Correct ?    2 Yes 1 No

I have a class which is abstract which contains only the abstract methods. This is similar to an in..

Answer / madhav

Interface is preferable to Abstract class as when ever in
instance is created for subclasses of this,constructors
will be called hirarchially consuming some time for each
constructor call..

Is This Answer Correct ?    0 Yes 0 No

I have a class which is abstract which contains only the abstract methods. This is similar to an in..

Answer / ashoka

Better to choose Abstract class. Because it contains not
only the abstract methods but also implemented methods but
in interfaces only unimplemented methods will be there and
all final variables will be there.

Is This Answer Correct ?    0 Yes 1 No

Post New Answer

More Core Java Interview Questions

Does java return by reference?

0 Answers  


What does it mean to flush a file?

0 Answers  


What are the names of Component subclasses that support painting?

1 Answers  


can we create a instance for intwerface?

3 Answers  


What is difference between static class and singleton pattern?

0 Answers  


What is primitive data type in java?

0 Answers  


Write an algorithm program in java for the following question.. 1) S is a set of integers.X is an integer obtained by sum of two digits in S. Write logic for whether or not the X is from the S. The time of algorithm should not exceed o(n logn).

0 Answers  


What is onClassLoader in java?

5 Answers   Cap Gemini,


What are the 8 primitive data types in java?

0 Answers  


What is the purpose class.forname method?

0 Answers  


what is dynamic method dispatch ?

27 Answers   Fidelity, MUET, SDSF,


Difference between throw and throws?

0 Answers  


Categories