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
What is multithreading in java?
What is numel matlab?
Can a constructor be made final?
What is the difference between a scrollbar and a scrollpane?
What are the five major types of reference sources?
What was java originally called?
What is a ternary operator in java? What is an interface?
What is the indent key?
What is oop principle in java?
What is the advantage of OOP in java?
What is concurrent hashmap and its features?
How we can skip finally block of exception even if some exception occurs in the exception block in java?
Is it possible to use Semaphore/ Mutex in an Interrupt Handler?
What is the difference between multitasking and multithreading in Java
What access modifiers can be used for methods?