AF
Home
Tag
Submit Notes
Ask Anything
Login
Subscribe Us
A
ny
F
orum
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 ?.
Follow @anyforumin
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
Rishi Kumar
523
1882
45674
3
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
Saksham Kumar
734
339
36114
Reply This Thread
5
Post Answer
Please Login First to Post Answer:
Login
Answer:
anyforum.in