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
Which oo concept is achieved by using overloading and overriding?
Can we declare a constructor as final?
What is java util?
What will be the default values of all the elements of an array defined as an instance variable?
What is loop in java?
What is treeset in java?
How are the elements of a gridbaglayout organized?
Can we create an object of private class?
Is math an abstract class in java?
How do you sort a set in java?
What are design patterns and please explain?
What is dynamic array in java?
What is the full meaning of java?
What is java string pool?
What is null data type?