Can there be an abstract class with no abstract methods in it?



Can there be an abstract class with no abstract methods in it?..

Answer / pankaj kumar

Yes,If A class have an abstract method the class must be declared as abstract, but if a class is declared as abstract
then,this is not mandatory that class hold any abstract method.

exa :
1. public Abstract class a{

// instance method;
}
///Above declaration is right

2. public class a{

// instance method;
// abstract method; //then you must declare this class as abstract.
}
///Above declaration is right

Is This Answer Correct ?    13 Yes 2 No

Post New Answer

More Core Java Interview Questions

class A{ some variables; public void a()throws Excepion1,Exception2{....} } class B extends A{ variables... public void a()throws E2,E3{.....} } Qns: here override of methods occurs or not,ore else wil give any compilation error or run properly..plz tell me briefly whts happening with the above codes....

4 Answers   Quinnox,


Why is it called buffering?

0 Answers  


How big is a pointer?

0 Answers  


Which eclipse is best for java?

0 Answers  


how can we synchronize Hash map?

3 Answers   CTS,






What is an abstract class?

7 Answers   DBS, Wipro,


Why is java called java?

0 Answers  


What are the advantages of assembly language?

0 Answers  


Can inner class have constructor?

0 Answers  


Which of these methods belong to Thread & Object class? join, yield, sleep, wait, notify

3 Answers   Ericsson,


Why does java not allow multiple public classes in a java file ?

2 Answers  


There are 2 different ways to create an object. a)By using keyword "new" b)By using Class.forName ("className").newInstance(); What is the difference between these 2 methods.

3 Answers  


Categories