• 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:
  • Tim Cooke
  • Campbell Ritchie
  • paul wheaton
  • Jeanne Boyarsky
  • Ron McLeod
Sheriffs:
  • Paul Clapham
  • Devaka Cooray
Saloon Keepers:
  • Tim Holloway
  • Carey Brown
  • Piet Souris
Bartenders:

answer??

 
Ranch Hand
Posts: 252
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
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


why cant answer be 2??

thanks

srikanth
 
Ranch Hand
Posts: 657
Spring VI Editor Clojure
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator

why cant answer be 2??

Because all interface methods are inherently coderanch, and you can't implement/override a method with a more restrictive access modifier (e.g., "friendly").
 
Ranch Hand
Posts: 7729
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Please tell us the source of the question.

And, please use a more informative topic title.
[ September 06, 2005: Message edited by: Barry Gaunt ]
 
Consider Paul's rocket mass heater.
reply
    Bookmark Topic Watch Topic
  • New Topic