wood burning stoves 2.0*
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 Android Security Essentials Live Lessons this week in the Android 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: 19655
    
  18

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: 10172
    
    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: 38046
    
  22
You see the confusion you are causing by asking the same question twice. Closing thread as a duplicate.
Please continue here.
 
It is sorta covered in the JavaRanch Style Guide.
 
subject: Java
 
Similar Threads
Doubt about diagram class (realization)
WA #1.....word association
can non-static inner class access any member
andrew has wii
Doubt about diagram class