Answer Posted / saroj kumar biswal
no we can't have constructor in an interface, why bcz constructor is used to initialize the instance variable stored in an object. Constructor is called concurrently while creating object. We can't create object to interface & also we can't provide instance variable to interface. So we can't use constructor in an interface
| Is This Answer Correct ? | 30 Yes | 3 No |
Post New Answer View All Answers
Which command from the jdk compiles a java program?
What are computer functions?
What is flush () in java?
What is the use of inner class?
What is an inner class in java?
Can we have a try block without catch block?
Difference between string s= new string (); and string s = "abv";?
What is difference between arraylist and list in java?
What data type is true or false?
How do you use compareto in java?
What are features of java?
Can I uninstall java?
What is meant by class?
Which package is always imported by default?
Difference between ‘>>’ and ‘>>>’ operators in java?