This week's giveaway is in the EJB and other Java EE Technologies forum.
We're giving away four copies of EJB 3 in Action and have Debu Panda, Reza Rahman, Ryan Cuprak, and Michael Remijan 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 EJB 3 in Action this week in the EJB and other Java EE Technologies 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: 24166
    
  30

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
 
It is sorta covered in the JavaRanch Style Guide.
 
subject: How to pass value from one file to anaother
 
Similar Threads
global variables in Javascript
Jdbc j2ee MySQL
passing more than one parameter to html link tag
Dynamically param value from same HTML
resource file strings.xml change data