Win a copy of Programmer's Guide to Java SE 8 Oracle Certified Associate (OCA) this week in the OCAJP forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

hi default acess specifier

 
Ashok Renukappa
Greenhorn
Posts: 1
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Dear Friends
I just want to know what is the default acess specifier inside a class is it public or package or protected
 
Barry Gaunt
Ranch Hand
Posts: 7729
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
You mean in the case of a method like m1() as follows?



It implicitly has "package" access. (But I'm going to check that )

Yes. It checks out.
[ September 17, 2005: Message edited by: Barry Gaunt ]
 
Ritu Kapoor
Ranch Hand
Posts: 102
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi,

A class defined without any access specifier has package access.

Rgds,
Ritu
 
Barry Gaunt
Ranch Hand
Posts: 7729
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Originally posted by Ritu Kapoor:
Hi,

A class defined without any access specifier has package access.

Rgds,
Ritu


Certainly, but I do not think that is the question. The question seems to be about the members of a class.
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic