When we r go to abstract class and when we go to Interface?
i have confusion this question while in interview plz clarify

Answer Posted / atul

multiple inheritence is not possible so we use interface
instead of it.when we declare interface then inside declare
all methods is by default abstract, data member is by
default final & static .final means there is must
Initialization at declare time otherwise inside first
constructor call.
thats it...

Is This Answer Correct ?    11 Yes 0 No



Post New Answer       View All Answers


Please Help Members By Posting Answers For Below Questions

Tell me how many ways are there to initialise an integer with a constant.

645


Can a class declared as private be accessed outside it’s package?

512


Why is method overloading not possible by changing the return type in java?

590


Explain try and catch keywords in java?

621


What is independent and dependent variables in research?

470






What are the advantages of passing this into a method instead of the current class object itself?

1169


Does treeset use compareto?

541


What is the use of private static?

535


How can we find the actual size of an object on the heap?

804


What is sizeof in java?

555


Explain the private field modifier?

611


Which of the following classes will have more memory allocated?

582


What about main thread in java?

648


What means public static?

562


Under what conditions is an object’s finalize() method invoked by the garbage collector?

575