• Post Reply Bookmark Topic Watch Topic
  • New Topic

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

 
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
Marshal
Posts: 56578
172
  • 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
Boost this thread!