Can you have a constructor in abstract class?
Answer Posted / sam
Yes
abstract class test{
int i=10;
abstract void method();
test(){
System.out.println("Abstract class constructor");
}
}
public class test1 extends test{
void method(){
//implement abstract method of test
}
public static void main(String args[]){
test1 t=new test1();
}
}
Is This Answer Correct ? | 29 Yes | 2 No |
Post New Answer View All Answers
Can we increase array size dynamically in java?
What is array and arraylist in java?
What is java and its types?
What is get () in java?
What is the mapping mechanism used by java to identify IDL language?
How do I type unicode?
I want to persist data of objects for later use. What’s the best approach to do so?
What is meant by data hiding/encapsulation?
What is preflight request?
What is a databasemetadata?
What is difference between wait and notify in java?
Can we declare a static variable inside a method?
Is arraylist an object in java?
What do you know about java?
What is array sorting in java?