Win a copy of Design for the Mind this week in the Design forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

Classes

 
Aru
Ranch Hand
Posts: 112
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi ALl,
This is from the IBM Mock test. An answer along with an explantion is requested.
Which the following are legal for the top level class FROG ?
1. protected class Frog extends Animal
2. private class Frog extends Animal
3. transient class Frog extends Animal
4. native class Frog extends Animal
Thx
Aruna
 
Chitra Natarajan
Greenhorn
Posts: 13
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi Aruna,
As I know, top level classes may not be private,protected. transient is applicable only for variables.
native is applicable only for functions ( to call a fn. of like c/c++).
So none of the answers are correct.
Originally posted by Aru:
Hi ALl,
This is from the IBM Mock test. An answer along with an explantion is requested.
Which the following are legal for the top level class FROG ?
1. protected class Frog extends Animal
2. private class Frog extends Animal
3. transient class Frog extends Animal
4. native class Frog extends Animal
Thx
Aruna

 
Aru
Ranch Hand
Posts: 112
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi Chitra,
Thanks for ur explanation, That was the same thing what I thought too. But what to answer if such question is posed in the SCJP ? Should a answer be selected or can it be left blank....
Confused.
Aruna.
 
Jim Yingst
Wanderer
Sheriff
Posts: 18671
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
On the real exam (but not IBM's apparently), there will always be at least one correct answer. So if you can't find one, keep looking.
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic