This week's book giveaway is in the OO, Patterns, UML and Refactoring forum.
We're giving away four copies of Refactoring for Software Design Smells: Managing Technical Debt and have Girish Suryanarayana, Ganesh Samarthyam & Tushar Sharma on-line!
See this thread for details.
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’ve looked at a lot of different solutions, and in my humble opinion Aspose is the way to go. Here’s the link: http://aspose.com
 
subject: Default Access Specifier
 
It's not a secret anymore!