This week's giveaway is in the Android forum.
We're giving away four copies of Android Security Essentials Live Lessons and have Godfrey Nolan on-line!
See this thread for details.
The moose likes Beginning Java and the fly likes How to pass value from one file to anaother 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
Bookmark "How to pass value from one file to anaother" Watch "How to pass value from one file to anaother" New topic
Author

How to pass value from one file to anaother

Gaurav Ram
Ranch Hand

Joined: Feb 23, 2008
Posts: 32
Hi,

I am having 2 java files and i have to pass one value from first file to another.

Can you please suggest me the way i can achieve this.

Thanks,
Gaurav
Ernest Friedman-Hill
author and iconoclast
Marshal

Joined: Jul 08, 2003
Posts: 24183
    
  34

Hi,

Classes communicate by calling each other's methods. They exchange information by passing arguments to those methods. Make sense? Let us know if you need more of an explanation.


[Jess in Action][AskingGoodQuestions]
Gaurav Ram
Ranch Hand

Joined: Feb 23, 2008
Posts: 32
Sir, Thanks for your reply.

Its fruitful for me.
Dave DiRito
Ranch Hand

Joined: Feb 08, 2008
Posts: 77
This is just what I've been trying to understand. Can anyone point me to some good, basic examples of this?
marc weber
Sheriff

Joined: Aug 31, 2004
Posts: 11343



"We're kind of on the level of crossword puzzle writers... And no one ever goes to them and gives them an award." ~Joe Strummer
sscce.org
Dave DiRito
Ranch Hand

Joined: Feb 08, 2008
Posts: 77
Marc,
Excellent example! Thank you again. I really appreciate your help.

Dave
 
 
subject: How to pass value from one file to anaother
 
Similar Threads
resource file strings.xml change data
Dynamically param value from same HTML
Jdbc j2ee MySQL
global variables in Javascript
passing more than one parameter to html link tag