Ross Walker

Greenhorn
+ Follow
since Apr 26, 2003
Cows and Likes
Cows
Total received
0
In last 30 days
0
Total given
0
Likes
Total received
0
Received in last 30 days
0
Total given
0
Given in last 30 days
0
Forums and Threads
Scavenger Hunt
expand Ranch Hand Scavenger Hunt
expand Greenhorn Scavenger Hunt

Recent posts by Ross Walker

I know what native means, but I don't see how it can be legal in this context, as I explained above.
Near the bottom of page 115, they state that "The public modifier is required if you want the interface to have public rather than default access". However, in the two-minute drill on page 133, they state that "Interfaces are by default public and abstract - explicit declaration of these modifiers is optional."
These seem to be contradictory statements to me. I have checked the errata, and there's no mention. Am I missing something?
Suppose the first statement was true, and the interface had default (package) access if it wasn't explicitly declared public. Wouldn't all the constants and methods also have default (package) access, instead of public? But the two minute drill states that constants and methods are implicitly final.
Can anyone clarify this for me?
Thanks,
Ross.
According to the self-test answers, the following is a legal method declaration:
private native void m1();
I don't see how this could be legal. It ends in a semi-colon instead of curly braces, so it can't be a concrete method, it must be abstract. Since abstract isn't one of the explicit modifiers, the method must be in an interface, not a class. But you can't have private methods in an interface! Furthermore, abtract methods can't be native.
Can someone please help me out here?
Thanks,
Ross.