Question 6.
An Interface can never be private or protected.
Answers True or False ?
The answer is False. I don't understand in what situation the interface could be private or protected?
Question 59.
Interface methods can be declared with the following modifiers
1 public
2 none (i.e., no access modifier).
3 private.
4 static
5 native
6 synchronized.
The answer is 1 and 2. But according to <<Exploring
JAVA>> by Patrick Niemeyer & Joshua Peck, it says:"The methods of an interface are always considered public"(p167). So could 'none' be a modifier of interface?
Question 60.
Which of the following are true about the class defined inside an interface
1 it is not possible in the java Laungage.
2 The class is always public.
3 The class is always static.
4 the class methods cannot call the methods declared in the interface.
Answer is 2, 3&4. Could sb. give me an example how to create the instance class? Should we implement the interface first?
5 the class methods can call only the static methods declared in the interface.