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 identifier give example?
What are computer functions?
Are registers volatile?
Why is java logo a cup of coffee?
What is use of inner class in java?
What are the java ide's? Explain
How do you create a method in java?
What is consumer interface?
Who is the owner of java?
explain copyonwritearraylist and when do we use copyonwritearraylist?
What is run time allocation?
Can we use catch statement for checked exceptions?
Can you instantiate the math class?
Can we use this () and super () in a method?
What is the difference between private & public & friendly classes?