A friendly place for programming greenhorns!
Big Moose Saloon
Register / Login
Help needed with access specifiers
Joined: Jan 04, 2010
Jan 04, 2010 23:45:01
This is probably more of a design question.
How would we use
access specifers in designing a real world class.Java textbooks tend to give a rather rigid definition
In short i am looking for a REAL example.
Joined: Jan 12, 2009
Jan 05, 2010 00:04:55
It depends on a scenario,
usually i prefer to use private for all class instance variables,
protected for methods (mostly not variables) that can be accessed to same package
public for methods that can be accessed every where
My Website: [
] Cool your mind:[
] My Sally:[
Joined: Oct 13, 2005
Jan 05, 2010 04:29:05
And welcome to JavaRanch
I agree. Here's the link:
subject: Help needed with access specifiers
Sun to fire 3,000 employees
New way to attract indian techies
What is the best data base to use?
Does Scjp1.4 test AWT and IO?as I know AWT and IO will not be tested?Is it real?
Complete SCEA 5 Exam Survey /Free exam voucher $200 US Value
All times are in JavaRanch time: GMT-6 in summer, GMT-7 in winter
| Powered by
Copyright © 1998-2014