Can we define abstract method in non abstract class?
I'll answer
Earn 20 gold coins for an accepted answer.20
Earn 20 gold coins for an accepted answer.
40more
40more
Studied at McGill University, Lives in Montreal, Canada
Declaring a class abstract only means that you don't allow it to be instantiated on its own. Declaring a method abstract means that sub classes have to provide an implementation for that method. The two are separate concepts, but obviously you can't have an abstract method in a non-abstract class.
2023-06-18 06:42:30
评论(499)
Helpful(122)
Helpful
Helpful(2)

Julian Cook
QuesHub.com delivers expert answers and knowledge to you.
Declaring a class abstract only means that you don't allow it to be instantiated on its own. Declaring a method abstract means that sub classes have to provide an implementation for that method. The two are separate concepts, but obviously you can't have an abstract method in a non-abstract class.