I'm trying to return the string "otheruser" from static void Answer2 to my main method.
public static void main(String[] args) {
System.out.println("is there another person with you?");
Scanner Answer2 = new Scanner(System.in);
String answer2 = Answer2.nextLine();
if (answer2.equals("yes")) {
System.out.println("ok then type there name in please");
Answer2();
} else if (answer2.equals("no")) {
System.out.println("ok then good day");
}
System.out.println("how old are you " + Answer2());
}
static void Answer2() {
Scanner otheruser = new Scanner(System.in);
String Otheruser = otheruser.nextLine();
System.out.println("hi " + Otheruser);
}