Latest Version Already Passed
What keyword is used to implement an interface?
✔✔ **implements**
Can an interface have a constructor?
✔✔ No, interfaces cannot have constructors
What happens if a class does not implement all methods of an interface?
✔✔ The class must be declared **abstract**
Can a static method be overridden?
✔✔ No, static methods belong to the class, not instances
What is the purpose of the **final** keyword when used with a class?
✔✔ It prevents the class from being inherited
1
,What is a default constructor?
✔✔ A constructor with no parameters provided by Java
Can a constructor be overloaded?
✔✔ Yes, constructors can have multiple definitions with different parameters
What is a copy constructor?
✔✔ A constructor that creates a new object as a copy of an existing object
Can a method inside an interface have a body?
✔✔ Yes, with **default** or **static** methods since Java 8
What is the main advantage of using interfaces?
✔✔ They allow multiple inheritance of behavior
Can an interface extend another interface?
✔✔ Yes, an interface can extend multiple interfaces
2
, Can a final method be abstract?
✔✔ No, because **final** prevents overriding, while **abstract** requires it
What does the keyword **"this"** refer to in Java?
✔✔ The current instance of the class
What is the purpose of a constructor in Java?
✔✔ To initialize objects of a class
Can a constructor return a value in Java?
✔✔ No, constructors do not have a return type
How do you call a superclass constructor from a subclass?
✔✔ Using the **super()** keyword
What happens if you do not define a constructor in a class?
✔✔ Java provides a default constructor
3