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 binary tree in java?
What an i/o filter in java programming?
What is the arraylist in java?
How many types of flags are there?
What is the different types of functions?
How to sort elements in a parallel array in java?
What are the drawbacks for singleton class?
Explain access modifiers in java.
How does java pattern compile work?
How do you convert an int to a string in java?
What is string english?
What is the synchronized method modifier?
Variables used in a switch statement can be used with which datatypes?
What is the output of the below java program?
How do I compare two strings in word in java?