[JAVA] basic debugging
Go to solution
Solved by NoRomanBatmansAllowed,
Go over to /r/JavaHelp for a lot more (and usually a lot quicker) people who help.
So what you're doing in line 20 is you're defining a method. A method has 2 arguments. The thing with methods in Java, unlike pleb languages like python or JS, is that you need to set the type of variable you'd input. So in this case:
public static void addNums(int a, int b){
and you would not redefine the variables after it.
You don't have to assign the result to an int either, so a cut down version of this would be
public static void addNums(int a, int b){ return a+b; }

Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now