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 are the disadvantages of indexes in oracle?
Explain about transient variables in java?
What is the difference in between cpp and java? Can u explain in detail?
What is string data?
What state does a thread enter when it terminates its processing in java programming?
Explain an intermediate language?
How do you override a variable in java?
can used Protected Class outside Function.?
Does list allow duplicates in java?
What is a hashmap used for?
what is encapsulation in java? Explain
What is the purpose of the main method?
Are there structures in java?
What is keyset in java?
What is the map interface in java programming?