Hi all,
Trying to simply call method, (below) from another class and return the value found by the scanner. Please see below:
public int getInt(String prompt) {
System.out.print(prompt + "a");
//int result = in.nextInt();
if (in.hasNextInt()) {
x = in.nextInt();
y = in.nextInt();
sum = x+y;
System.out.print("sum" + sum);
}
int value = 5+5;
return value;
}
when I run this after compiling with no errors I receive the java.lang.NoSuchMethodError ... getInt(L/java/lang/String;)V at ...
Could you please advise how to return a value from the other class?
Much appreciated,