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
If goto and const is reserve words than why it is not work in java?
What is runtime polymorphism or dynamic method dispatch?
What is void in java?
What is floor in java?
What is a website container?
What is use of static method?
What is the main function in java?
How to convert string to byte array and vice versa?
What super () does in java?
Is an array a vector?
What are the library functions in java?
Is a string literal?
Explain access modifiers in java.
Write a program to reverse array in place?
What are the different tags provided in jstl?