Hi everyone,
I just wanted to ask a question regarding methods and parenthesis
So say I have code like this:
Jacks class {
int age = 29;
String name = Jack;
Public void randomMethod(Int ageNew, String namePerson) {
ageNew = age;
namePerson = person;
/my question is when I declared the variable age and name outside of this method, why would I need to use a new name in the parenthesis of this method and then attach those new parenthesis variables ageNew and namePerson to the variables outside the method, it’s just seems like going round the houses a bit and could just use the original variables name and age declared outside of the method, I’m sure theirs a reasonable explanation for this I just want to undertand it as it puzzles me?\
//and then I’d write a function here for the method
}
Public static void main(String args) {
}
}