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
Is a boolean variable?
What does 3 dots mean in java?
Why to use nested classes in java? (Or) what is the purpose of nested class in java?
What is an iterator java?
Can we rethrow the same exception from catch handler?
What restrictions are placed on method overriding?
What is a qualifier in a sentence?
Why are generics used?
Where we write javascript code in html page?
Explain what is encapsulation?
Is string a datatype?
Which data type is class in java?
What are instance variables?
Can substring create new object?
Write a program in java to establish a connection between client and server?