Thanks A.jyotsna,
Can u tell me differnce between abstract class and interface
vikash
Answer Posted / rakesh kumar jha
Abstract class:-
1. if we declare ny class as a abstract, then we can't
create an object/instace of that class explicitly.
2.afbstracts class may or may not contain abstract method.
3. if on declare any method as an abstract, then the class
should be declared as abstract.
4.if a method is declared as abstract in abstract class,
then child bound to define the abstract method of parent.
5.abstract class may contain constructor.
6.abstract class may hold the child object.
Interface class:-
1.by default all method be abstract.
2.class can implements more than one interface class.
3.child should give the body of all method of interface
class, but if a child class with abstract keyword, then nod
need to give the body of interface classes method.
4.interface can't create objects but can hold the object of
child.
5. variable in interface class are by default public,
static and final.
6.we can't use the final, static, native,synchronous
keyword with the methods define in interface.
7. we can't declare interface as final.
if any question have, tell me at rkjhaw@sify.com or
info@shandilya.org
| Is This Answer Correct ? | 1 Yes | 0 No |
Post New Answer View All Answers
What are static initalizers in java ?
Define "Access specifiers" in java.
What are the two ways to create a thread?
What is the use of coding?
Explain why wait(), notify() and notifyall() methods are in object class rather than in thread class?
What is the protected method modifier?
When we should use serialization?
What is array length in java?
What is widening and narrowing in java? Discuss with an example.
What are the important features of Java 10 release?
What is prefix of a string?
Which way a developer should use for creating thread, i.e. Sub classing thread or implementing runnable.
How to instantiate member inner class?
What are byte codes?
Explain the concept of proper inheritance?