Forums Register Login

Selftest question

+Pie Number of slices to send: Send
I am preparing for the SCJP exam. I am reading the bookd by Dathy S. and Bert B. I have a question about the answer for chapter 2 selftest 5.
FYI, here is the question:
How many of the following are legal method declarations?
1 - protedcted abstract void m1();
2 - static final void m1(){}
3 - transient private native void m1(){}
4 - synchronized public final void m1() {}
5 - private native void m1();
6 - static final synchronized protected void m1() {}
The answer said only 3 is illegal. I do hava a question about 1: If a method is abstract, the class that has it has to be abstract. If the class is abstract, then the method it contains has to be public. So I think statement 1 is illegal also.
Am I right? Or am I missing something?
Thanks
crispy bacon. crispy tiny ad:
a bit of art, as a gift, the permaculture playing cards
https://gardener-gift.com


reply
reply
This thread has been viewed 846 times.
Similar Threads
doubt in K&B book.. pg:135
Confusing SCJP question!
Questions on for Kathy Sierr or Bert Bates
K/B Pg135 Self Test
Legal method declarations
More...

All times above are in ranch (not your local) time.
The current ranch time is
Apr 16, 2024 05:02:40.