I feel somehow I don't understand point of using "return" value, so I will give you two examples and maybe someone will clear that up for me. What is the difference between this method:
int giveSecret(){
return 42;
}
//code in between
int theSecret = life.giveSecret();
System.out.println(theSecret);
(my expected console output): 42
and this method:
void giveSecret(){
//code that "resets" variable to value 42
}
//code in between
int theSecret = life.giveSecret();
System.out.println(theSecret);
(my expected console output): 42