GeeCON Prague 2014*
The moose likes Java in General and the fly likes Default Access Specifier Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


JavaRanch » Java Forums » Java » Java in General
Bookmark "Default Access Specifier " Watch "Default Access Specifier " New topic
Author

Default Access Specifier

Senthamizh
Greenhorn

Joined: Nov 16, 2001
Posts: 18
Hi, May i know the default Access Specifier in JAVA.
In Java 2 : The Complete Reference,FOURTH EDITION They mentioned in one example, a variable public by default. Is it correct?.
In that book, kindly see the page,
Page No: 192,
Topic: Member Access and Inheritence
In class A {
int i; //public by default
..................................................
if it is correct means, i want explanation, please......
Bosun Bello
Ranch Hand

Joined: Nov 06, 2000
Posts: 1510
If no specifier is actually included in class/method/variable declaration, it defaults to "package", which makes accesibility open to members in the same package, if a package is specified, or members in the same directory, if there is no package statement included.
------------------
Bosun
SCJP for the Java� 2 Platform


Bosun (SCJP, SCWCD)
So much trouble in the world -- Bob Marley
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: Default Access Specifier