Win a copy of Design for the Mind this week in the Design forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

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

 
jayaprakash kaluva
Greenhorn
Posts: 4
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi,
Why can't we declare variables in interface as "PROTECTED".
 
Campbell Ritchie
Sheriff
Posts: 48652
56
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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.
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic