Which definitions of the MyInterface interface are correct?
Explanation
All declared methods are public in intefaces, public keyword is optional. Abstract keyword is optional too. As they are applied by default, they are redundant and should not be explicitly declared.
Interface fields are constants and have to be initialized.
Interfaces can have method definitions but methods myst be declared with default keyword.

It is initial var

2017 Feb 21, 5:56:16 AM

what's wrong with: "public int i; "?

2017 Jan 18, 12:19:41 AM

Follow CodeGalaxy

Mobile Beta

Get it on Google Play
Send Feedback
Cosmo
Sign Up Now
or Subscribe for future quizzes