I need to understand how to pass data gathered in one .java file to another.java file. For instance, I ask a user for their name and age. The I want to send the name and agae variable to another .java file to compute their birth day by subtracting their age from the current year. I then want to send the data bak to the first .java file to output the birth year. I know I need to use instantiation, but I don't know where or how. Any help would be appreciated. Thanks.
This question is in reference to a assignment. My specific example is not part of the assignment but just the type of assignment. I essentially as supposed to pass data from one .java file to another. THe variables have to be gathhered in the first file and computed in the second? THanks.
Joined: Jun 29, 2003
THe tutorial was good but not much help. Any other suggestions?