The Artima Developer Community
Sponsored Link

Java Answers Forum
interface designing

1 reply on 1 page. Most recent reply: Dec 26, 2007 6:31 AM by Stephen Morrow

Welcome Guest
  Sign In

Go back to the topic listing  Back to Topic List Click to reply to this topic  Reply to this Topic Click to search messages in this forum  Search Forum Click for a threaded view of the topic  Threaded View   
Previous Topic   Next Topic
Flat View: This topic has 1 reply on 1 page
amardeep gupta

Posts: 2
Nickname: toamardeep
Registered: Dec, 2007

interface designing Posted: Dec 18, 2007 4:49 AM
Reply to this message Reply
Advertisement
interface has only public method . we cat't put default or protected method in interface.it may be possiable when we design a application some method of a class may be default or protected according to my application requirment.in such case as we can't put such method in interface so why we can't defaut or protected method in interface


Stephen Morrow

Posts: 5
Nickname: yawmark
Registered: Jan, 2007

Re: interface designing Posted: Dec 26, 2007 6:31 AM
Reply to this message Reply
> so why we can't defaut or protected method in interface

The purpose of an interface is to define the public API of a type; i.e., the public contract which an implementation must fulfill. More restrictive method access qualifiers don't belong in an interface declaration. You can use an abstract class for that.

~

Flat View: This topic has 1 reply on 1 page
Topic: interface designing Previous Topic   Next Topic Topic: Implementing network print spooler

Sponsored Links



Google
  Web Artima.com   

Copyright © 1996-2019 Artima, Inc. All Rights Reserved. - Privacy Policy - Terms of Use