what is the difference between abstract class and
Interface?where we can use it in realtime projects?

Answer Posted / nitesh

1)We define an Interface in the Java application with a
set of abstract methods without any implementation. Which
means all the methods of an interface are by default
abstract methods and public methods.
2)Once an Interface is defined in the application then any
class can implement that interface, in such case the class
must be implemented with all the mehtods of the respective
Interface otherwise the class will become as abstract class.
3)A class can implement any no. of interfaces, in such case
the class must be implimented with all the methods of those
interfaces otherwise the class will become as abstract class

Is This Answer Correct ?    1 Yes 0 No



Post New Answer       View All Answers


Please Help Members By Posting Answers For Below Questions

Which is bigger float or double java?

528


Which is faster call by value or call by reference?

503


What is bytecode in java ?

612


Explain the difference between protected and default access.

518


What happens if constructor is private?

566






What is unsigned char?

629


What is the final keyword?

559


Explain an intermediate language?

513


Explain with example the concept of constant variable in java.

640


Can we assign integer value to char in java?

515


Why we cannot override static method?

563


Is string is a data type in java?

593


What are static initalizers in java ?

586


What is the difference between synchronized and synchronized block?

507


What’s meant by anonymous class?

606