my dog learned polymorphism*
The moose likes Beginning Java and the fly likes Java Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of OCM Java EE 6 Enterprise Architect Exam Guide this week in the OCMJEA forum!
JavaRanch » Java Forums » Java » Beginning Java
Reply locked New topic
Author

Java

Bushra Fathima
Greenhorn

Joined: Oct 22, 2008
Posts: 11
How can i get the value stored in the member variable of one class in another class of the same package.
Rob Spoor
Sheriff

Joined: Oct 27, 2005
Posts: 19685
    
  20

Please Use A Meaningful Subject Line. Most of this entire board is about Java, so using that as the subject line is not meaningful.


SCJP 1.4 - SCJP 6 - SCWCD 5 - OCEEJBD 6
How To Ask Questions How To Answer Questions
Maneesh Godbole
Saloon Keeper

Joined: Jul 26, 2007
Posts: 10270
    
    8

Originally posted by Bushra Fathima:
How can i get the value stored in the member variable of one class in another class of the same package.


Welcome to the ranch. We are happy to have you here
The normal way to do this via a getter method.
e.g. public Object getValue();


[How to ask questions] [Donate a pint, save a life!] [Onff-turn it on!]
Campbell Ritchie
Sheriff

Joined: Oct 13, 2005
Posts: 38519
    
  23
You see the confusion you are causing by asking the same question twice. Closing thread as a duplicate.
Please continue here.
 
jQuery in Action, 2nd edition
 
subject: Java