rect answerA class Manager wants to implement an interface Salary. Which of the following is the correct way of implementing it?
Question
Solution 1
The correct way to implement an interface in Java would be:
public interface Salary {
// methods
}
public class Manager implements Salary {
// methods
}
Here are the steps:
- Define the interface using the
interface
keyword. In this case, the interface is namedSalary
. I Knowee AI StudyGPT is a powerful AI-powered study tool designed to help you to solve study prob
Knowee AI StudyGPT is a powerful AI-powered study tool designed to help you to solve study problem.
Knowee AI StudyGPT is a powerful AI-powered study tool designed to help you to solve study problem.
Knowee AI StudyGPT is a powerful AI-powered study tool designed to help you to solve study problem.
Knowee AI StudyGPT is a powerful AI-powered study tool designed to help you to solv
Similar Questions
rect answerA class Manager wants to implement an interface Salary. Which of the following is the correct way of implementing it?
ect the correct answerWhich of the following is the correct way of implementing an interface A by class B?
rect answerWhich of these package is used for graphical user interface?Optionsjava.appletjava.awt.imagejava.awtjava.io
Select the correct answerWhich of the following is used for implementing inheritance through an interface?Optionsinheritedusingextendsimplements
rect answerWhat type of methods an interface contain by default?Optionsabstractfinalstaticprivate