Can you pass parameters from one method into another method?
Hello everyone, I am attempting to write a program whereby it calculates the total amount of cash that the user has and also the interest. I have done that..what i now want to do is allow the user to add more money into their account. I currently have one static method which is to basically collect all the information as well as a for loop because i'm letting the user choose the rate of interest, principle value and year...what i tried to do is create a new method which just stores the number that the user chooses and then wanted to call my previous method to pass that value into it.
For the time being i just want to know if it is possible to pass this number that is currently stored in a method into a different method. Sorry if this is unclear or for any misuse of terminology (please correct me on my terminology also XD ) Thankyou!
Re: Can you pass parameters from one method into another method?
Code Java:
public static void methodA()
{
int x = 5;
methodB(x);
}
public static void methodB(int x)
{
System.out.println("x = " + x);
}
Re: Can you pass parameters from one method into another method?