Which of the following is a correct interface?
A.interface A { void print() { } }
B.abstract interface A { print(); }
C.abstract interface A { abstract void print(); { }}
D.interface A { void print(); }
Answers
Answered by
1
ⓗⓔⓨ ⓕⓡⓘⓔⓝⓓ
⊙ It's option c
Hope it helps you
⊙ It's option c
Hope it helps you
Answered by
0
Option (D) is correct
In Java, an interface is a blueprint for a class. It features abstract methods and static constants.
About Interface syntax :
- In Java, an interface is a blueprint for a class. It features abstract methods and static constants.
- In Java, the interface is a means of achieving abstraction.
- The Java interface can only have abstract methods, no method bodies. In Java, it is used to achieve abstraction as well as multiple inheritances.
- To put it another way, interfaces can include abstract methods and variables. It is not allowed to have a method body.
Similar questions
Hindi,
7 months ago
French,
7 months ago
English,
7 months ago
Computer Science,
1 year ago
Computer Science,
1 year ago
Math,
1 year ago
English,
1 year ago