wood burning stoves
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


Win a copy of Head First Android this week in the Android forum!
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: 43396
    
  32
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.
 
It is sorta covered in the JavaRanch Style Guide.
 
subject: why can't we declare a protected fields in interface?
 
It's not a secret anymore!