Forums.Sureshkumar.net : A Perfect Place to Share Knowledge         Blogs     Games    Magazines    

"Sharing knowledge does not lessen your store, often it gets you more. Sharing plays a key role in relationships and bonding, happens in small steps and is assisted through community membership."

Go Back   SURESHKUMAR.NET FORUMS > TECHNICAL DISCUSSIONS > JAVA Technologies
Register FAQ Members List Calendar Games Blogs Search Today's Posts Mark Forums Read

   

Reply
 
LinkBack Thread Tools Rate Thread Display Modes
Old 16-02-06, 03:02 AM   #1 (permalink)
Junior Member
 
Join Date: Feb 2006
Location:
Posts: 16
Thanks: 0
Thanked 0 Times in 0 Posts
Thanks: 0
Thanked 0 Times in 0 Posts
Rep Power: 3 praveen has disabled reputation


Can anybody tell me why we should minimise the use of member variables in a class in Java.


its urgent. Please help.
praveen is offline  
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
Old 16-02-06, 03:15 AM   #2 (permalink)
Member
 
Join Date: Feb 2006
Location:
Posts: 42
Thanks: 0
Thanked 5 Times in 3 Posts
Thanks: 0
Thanked 5 Times in 3 Posts
Rep Power: 3 naga has disabled reputation
who said that we need to minimise the class variables..
i am member classes have almost 80 member variables..
but one thing u have to do .. make them private or protected
naga is offline  
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
Old 16-02-06, 12:36 PM   #3 (permalink)
Moderator
 
Join Date: Feb 2006
Posts: 1,413
Thanks: 0
Thanked 9 Times in 8 Posts
Thanks: 0
Thanked 9 Times in 8 Posts
Rep Power: 18 sowmya571 has disabled reputation
hello



why do u we use java since it has gud security purpose
right . We make all the variable as private /protected as naga said
mostly . but the use of private
variables will restrict those variables in other classes so thatz the
reason we only declare limited private member variables (where ever
necessary) rest all use public methods /variables .. depending on
functionality as well as complexity of code



bye



sowmya




__________________
http://livetolead.blogspot.com/
all the best
Arise Awake N Stop Not Until Ur Goal Is Reached!
sowmya571 is offline  
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
Old 18-02-06, 07:00 AM   #4 (permalink)
Member
 
Join Date: Feb 2006
Location:
Posts: 42
Thanks: 0
Thanked 5 Times in 3 Posts
Thanks: 0
Thanked 5 Times in 3 Posts
Rep Power: 3 naga has disabled reputation
but sowmya all the class variables are its properties... that defines an entity in realtime... those cant be public... but they can have setx and getx methods.
naga is offline  
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
Reply



Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)
 
Thread Tools
Display Modes Rate This Thread
Rate This Thread:

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is On
Trackbacks are On
Pingbacks are On
Refbacks are On


All times are GMT +6.5. The time now is 02:48 AM.





Search Engine Optimization by vBSEO 3.1.0