Here is my main method:
public class Main {
public static void main(String[] args){
Comp.give(f, s);
}
}
And here is my other class:
import java.util.Scanner;
public class Comp {
private void look() {
Scanner iscan = new Scanner(System.in);
int f = iscan.nextInt();
int s = iscan.nextInt();
}
public static Object give(int f, int s) {
return f + s;
}
}
I'd like to be able to use the two Ints f and s (first and second) in the main method.
And if that's a stupid question, I'd just like to be able to use a getter/call the give method from the main method. How do I do this?
I'm new to coding, so assume that I know next to nothing. Explain very thoroughly. Thanks!
EDIT - Code is supposed to take two ints and return the sum.