AF
HomeTagSubmit NotesAsk AnythingLoginSubscribe Us
AF
1. Feel Free to ask and submit anything on Anyforum.in and get satisfactory answer
2. Registration is not compulsory, you can directly login via google or facebook
3. Our Experts are looking for yours ?.



corejava-OOPs: why we can not create the object of the abstract class?

Please explain with proper reason of why we can not create the object of abstract class.

corejava x 353
OOPs x 49
Posted On : 2014-04-28 21:09:35.0
profile Rishi Kumar - anyforum.in Rishi Kumar
523188245674
up-rate
3
down-rate

Answers


As we know that abstract class may have some methods without it´s implementation. Also, we can define different access modifier with Abstract class constructor like private, protected or public.

An abstract class has a protected constructor by default allowing derived types to initialize it. The word abstract in java means one that can´t be created.

The concept behind abstract class is extend it in a class, and give the implementation of the methods you want to.

It may possible that some methods are not implemented in abstract class and in the case of an interface, non of the methods are implemented. If you would be able to create an instance, and call a non-implemented method, what code should be executed? Not that of the class / interface itself, since there is no code to be executed.

Posted On : 2014-04-28 22:40:15
Satisfied : 1 Yes  0 No
profile Saksham Kumar - anyforum.in Saksham Kumar
73433936114
Reply This Thread
up-rate
5
down-rate



Post Answer
Please Login First to Post Answer: Login login with facebook - anyforum.in