This week's book giveaway is in the Servlets forum.
We're giving away four copies of Murach's Java Servlets and JSP and have Joel Murach on-line!
See this thread for details.
The moose likes Programmer Certification (SCJP/OCPJP) and the fly likes Mock Exam Q Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of Murach's Java Servlets and JSP this week in the Servlets forum!
JavaRanch » Java Forums » Certification » Programmer Certification (SCJP/OCPJP)
Bookmark "Mock Exam Q" Watch "Mock Exam Q" New topic
Author

Mock Exam Q

Karthik Subramanian
Greenhorn

Joined: Aug 23, 2000
Posts: 27

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 public.
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
deekasha gunwant
Ranch Hand

Joined: May 06, 2000
Posts: 396
hi,

Question 9.

public interface AQuestion
{
void someMethod();
}
The class which implements AQuestion
1.Should have someMethod which must necessarily be public.
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
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: Mock Exam Q
 
Similar Threads
overriding
Interface question
answer??
Interface
class implementing interface