Can i have abstract class with no abstract methods?
Answer Posted / sitaram
yes,please find the below example.
abstract class AbstractClass1 {
public void method1(){
System.out.println("inside method1...");
}
}
class AbstractClass2 extends AbstractClass1{
public void method2(){
System.out.println("inside method2...");
}
}
public class AbstractDemo {
public static void main(String[] args) {
AbstractClass2 a = new AbstractClass2();
a.method1();
a.method2();
}
}
| Is This Answer Correct ? | 6 Yes | 2 No |
Post New Answer View All Answers
What is sortedset in java?
How many bytes are a float?
What are three ways in which a thread can enter the waiting state in java programming?
Why do we create threads in java?
Does java allow default arguments?
What is queue in java?
What methods are used to get and set the text label displayed by a button object?
State the main difference between c++ and java?
What is difference between overloading and overriding in java?
What is command line argument
What are access specifiers available in java?
What is numeric function?
Is space a character in java?
what is enumset?
Is singleton thread safe in java?