Friday Java Quiz: Know Your Interfaces
We go back to basics this week.
Q: Given the following interface definition:
interface Foo {
int ZERO = 0;
public int ONE = 1;
public static int TWO = 2;
public static final int THREE = 3;
void first();
abstract void second();
public abstract void third();
}
Which of the following are true (choose all that apply):
- ZERO is not public
- ONE is not static
- TWO is not final
- first() is not abstract
- second() is not public
- None of the above
- One of the above
- Two of the above
- Three of the above
- All of the above
And we revert back to strict rules: no books, no googling, no internet, no compiling. Just stare at the code and think.