aspose file tools*
The moose likes Beginning Java and the fly likes why can't we declare a protected fields in interface? Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Java » Beginning Java
Bookmark "why can Watch "why can New topic
Author

why can't we declare a protected fields in interface?

jayaprakash kaluva
Greenhorn

Joined: Aug 01, 2012
Posts: 4
Hi,
Why can't we declare variables in interface as "PROTECTED".
Campbell Ritchie
Sheriff

Joined: Oct 13, 2005
Posts: 38896
    
  23
Welcome to the Ranch

Because an interface is intended to create (part of) the public interface of a class. Everything in an interface is therefore implicitly public.
 
Don't get me started about those stupid light bulbs.
 
subject: why can't we declare a protected fields in interface?