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
What is variable in java?
What are the advantages of exception handling in java?
how can you catch multiple exceptions in java?
What is command line argument in java?
'A class is a template for an object' explain this statement.
What is an object's lock and which object's have locks in java programming?
what is optional in java 8?
What do heavy weight components mean in java programming?
Difference between ‘is-a’ and ‘has-a’ relationship in java?
How do you reverse a word in java?
What are examples of modifiers?
What does main method?
Why do we need hashmap in java?
Can we create our own wrapper class in java?
What is difference between module and function?