Engineering Full Stack Apps with Java and JavaScript
Which of the following are valid declarations inside an interface?
Select 2 options
A. void compute(); B. public void compute(); C. public final void compute(); D. static void compute(); E. protected void compute();
A, B
All interface methods have to be public. No access control keyword in the method declaration also means public in an interface. (Note that the absence of access control keyword in the method declaration in a class means package protected.)
Logged in users see lesser ads and get more features.
If you want to solve the questions together with the experts and understand the concepts better, please contact us using the contact form or WhatsApp numbers. Selected people get to do that without any additional charges.