• Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Tim Cooke
  • Ron McLeod
  • paul wheaton
  • Jeanne Boyarsky
Sheriffs:
  • Paul Clapham
  • Devaka Cooray
Saloon Keepers:
  • Tim Holloway
  • Roland Mueller
  • Himai Minh
Bartenders:

Mock Exam Q

 
Greenhorn
Posts: 27
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator

Hello Friends ,
This is from Abhilash's mock exam.
Question 9.

public interface AQuestion
{
void someMethod();
}
The class which implements AQuestion
1.Should have someMethod which must necessarily be coderanch.
2.Should have someMethod which could be "friendly" or public
3.Should have someMethod which should not throw any checked exceptions.
4.Should have someMethod which cannot be sychronized as sychronized is not in the signature of the interface
defination
The answers given are 1,3.
But my answer is 2,3.
1 is wrong, because the access modifier could be protected.
2 Though there is no keyword called friendly i assumed that he
was referring to friendly access specifier because he put
friendly word in double quotes("friendly").(What would you 0do?)
3. is right, because the super method is not throwing any
checked exceptions

Any takers,
Thanks
 
Ranch Hand
Posts: 396
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
hi,

Question 9.

public interface AQuestion
{
void someMethod();
}
The class which implements AQuestion
1.Should have someMethod which must necessarily be coderanch.
2.Should have someMethod which could be "friendly" or public
3.Should have someMethod which should not throw any checked exceptions.
4.Should have someMethod which cannot be sychronized as sychronized is not in the signature of the interface
defination
The answers given are 1,3.
But my answer is 2,3.

----------------------------------------------------------
1 is wrong, because the access modifier could be protected.
1 is right because all methods in an interface are public by default so u can't override them to make protected/private/friendly
---------------------------------------------------------
2 Though there is no keyword called friendly i assumed that he
was referring to friendly access specifier because he put
friendly word in double quotes("friendly").(What would you 0do?)
2 is wrong for the same reason
3. is right, because the super method is not throwing any
checked exceptions
yes 3 is right

regards
deekasha
 
Don't get me started about those stupid light bulbs.
reply
    Bookmark Topic Watch Topic
  • New Topic