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?

Answer Posted / 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       View All Answers


Please Help Members By Posting Answers For Below Questions

Which is dependent variable?

662


Can a class be declared as protected?

733


Difference between linkedlist and arraylist.

800


Is oracle charging for java?

774


What is sorting in java?

733


Which collection is best for sorting in java?

881


Can we use a switch statement with strings?

758


What is unicode full form?

744


Define jre i.e. Java runtime environment?

774


What 5 doubled?

726


What are loops in java? What are three types of loops?

780


What is the difference between multiple processes and multiple threads?

785


What is the final method?

818


Can we instantiate interface in java?

889


Does importing a package imports its sub-packages as well in java?

743