Two Laptop Bag*
The moose likes Beginning Java and the fly likes Very simple question, cant remember answer... Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of Murach's Java Servlets and JSP this week in the Servlets forum!
JavaRanch » Java Forums » Java » Beginning Java
Bookmark "Very simple question, cant remember answer..." Watch "Very simple question, cant remember answer..." New topic
Author

Very simple question, cant remember answer...

SAFROLE YUTANI
Ranch Hand

Joined: Jul 06, 2001
Posts: 257
When you define a member of a class like this...
String s;
...what type of scope does the member assume? Private, public, or protected?
SAF
Gregg Bolinger
GenRocket Founder
Ranch Hand

Joined: Jul 11, 2001
Posts: 15299
    
    6

I believe it assumes public scope to the class and inner classes.
------------------
Happy Coding,
Gregg Bolinger


GenRocket - Experts at Building Test Data
Jason Menard
Sheriff

Joined: Nov 09, 2000
Posts: 6450
Package scope, right?
Colin Kenworthy
Ranch Hand

Joined: Aug 06, 2001
Posts: 88
Yes, it has package scope: http://java.sun.com/docs/books/tutorial/java/javaOO/accesscontrol.html
Package is the default if you do not specify an access modifier.
 
Consider Paul's rocket mass heater.
 
subject: Very simple question, cant remember answer...
 
Similar Threads
interface
Stack overflow error !
Where did you hear of the ranch ?
How to get HttpSessionListener to respond?
Let's find who's got the most post & who's the oldest(?) registered member of Ranch!