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
Can a main method be overloaded?
What is supplier in java?
What is string in java with example?
Write a code to show a static variable?
What does java se mean?
What is boolean false?
There are two classes named classa and classb. Both classes are in the same package. Can a private member of classa can be accessed by an object of classb?
What is java and why do we need it? Explain
What is broken and continue statement?
What does singleton mean in java?
What does indexof mean?
What is treeset in java?
What is an example of a boolean?
How many bits is a string?
What is import java util arraylist?