aspose file tools*
The moose likes Mock Exam Errata and the fly likes About methods and variables in interface. Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of Spring in Action this week in the Spring forum!
JavaRanch » Java Forums » Certification » Mock Exam Errata
Bookmark "About methods and variables in interface." Watch "About methods and variables in interface." New topic
Author

About methods and variables in interface.

Nigel Chou
Ranch Hand

Joined: Oct 11, 2001
Posts: 47
Which of the following keywords can be applied to the variables or methods of an interface.
A. static B. private C. synchronized D. protected E. public
The mock exam's author regard A.E. as correct. But I think ACDE, because C and D can be applied to methods of an interface.

SCJP for Java 2, SCWCD, SCMAD
Nain Hwu
Ranch Hand

Joined: Sep 16, 2001
Posts: 139
Here are the rules:
For methods in an interface, they are implicitly
public abstract. No other modifiers are allowed.
For variables in an interface, they are implicitly
public static final. No other modifiers
are allowed.

[This message has been edited by Nain Hwu (edited October 19, 2001).]
Marcus Green
arch rival
Rancher

Joined: Sep 14, 1999
Posts: 2813
Have you considered trying to compile up some code with those modifiers to see for yourself?
Marcus


SCWCD: Online Course, 50,000+ words and 200+ questions
http://www.examulator.com/moodle/course/view.php?id=5&topic=all
 
Consider Paul's rocket mass heater.
 
subject: About methods and variables in interface.