Answers:
Yes, other nonabstract methods can access a method that you declare as abstract.
No, Abstract method has only definition no implementation so other methods cannot access it until and unless we provide the body in the sub class.
Posted by: Mohan
Contact Mohan
Yes , non abstract method can access abstract method , but this abstract method will be implemented in its subclass and the same will be invoked from the non abstarct method of abstract super class. if not implemented the subclass must also be an abstract class. so doesn't create any issue. Instance can't be created for the same .
Posted by: Yathiraja
Contact Yathiraja
abstract class Abc { abstract int hello(); int hai() { hello(); return 1; } } Yes, we can access the abstract method from non abstract methods, this way, this got compiled with no errors.
Posted by: Venkat
Contact Venkat
Yes, we can access the abstract method from non abstract methods, this way, this got compiled with no errors.
Posted by: Naren
Contact Naren
If you have the better answer, then send it to us. We will display your answer after the approval.
Rules to Post Answers in CoolInterview.com:-
There should not be any Spelling Mistakes.
There should not be any Gramatical Errors.
Answers must not contain any bad words.
Answers should not be the repeat of same answer, already approved.
Answer should be complete in itself.