Capgemini
Company
General Ability
General Knowledge
Is it compulsion for abstract class to have abstract method?
Read Solution (Total 15)
-
- In Java you declare that a class is abstract by adding the abstract keyword to the class declaration. Abstract class may or may not include abstract methods. Abstract classes cannot be instantiated, but they can be subclassed. Abstract class can have both implemented and unimplemented classes. But if a class have unimplemented method then it should be declared as Abstract.
- 8 years agoHelpfull: Yes(9) No(2)
- abstract class should contain normal methods as well as abstract methods but normal class should not contain any abstract methods. hence there is NO compulsion for abstract class to have abstract method.
- 8 years agoHelpfull: Yes(6) No(0)
- No abstract class can have abstract as well as concrete method
- 8 years agoHelpfull: Yes(4) No(0)
- not compulsory
- 8 years agoHelpfull: Yes(1) No(0)
- Yes, we can create abstract classes without any abstract methods.
- 8 years agoHelpfull: Yes(1) No(0)
- No,
Declaring a class abstract only means that you don't allow it to be instantiated on its own.
Declaring a method abstract means that subclasses 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. You can even have abstract classes with final methods but never the other way around. - 7 years agoHelpfull: Yes(1) No(0)
- no ,its not compulsory it can have both abstract and non abstract methods..
- 8 years agoHelpfull: Yes(0) No(0)
- No, Abstract class may or may not contain the Abstract Method...
- 8 years agoHelpfull: Yes(0) No(0)
- no , there is no need
- 8 years agoHelpfull: Yes(0) No(0)
- no, there is no condition like an abstract class should have abstract method
- 8 years agoHelpfull: Yes(0) No(0)
- Abstract class may or may not include abstract methods.
- 8 years agoHelpfull: Yes(0) No(0)
- no, there is no compulsion for abstract class to have abstract methods as abstract class can contain normal as well as abstract methods. the abstract class does not have 100% abstraction.
- 7 years agoHelpfull: Yes(0) No(0)
- no ,it is not compulsory for an abstract class to have abstract method.But the converse is not true,i.e, if a class is having an abstract method then class should be made abstract or else compiler will throw an error.
- 7 years agoHelpfull: Yes(0) No(0)
- Not compulsory
- 6 years agoHelpfull: Yes(0) No(0)
- No compulsion is required, an abstract class may or may not have abstract method in it.
- 6 years agoHelpfull: Yes(0) No(0)
Capgemini Other Question