Accessing int's, String's by methods.
Hey, I'm having a newbie problem with accessing specific integers (let's take that for instance) in void methods.
Code:
public class Methods
{
public void setVars()
{
int num1 = 4;
int num2 = 12 * 5 / 3;
}
public void calcVars(int num1, int num2, int calcs)
{
Methods calc = new Methods();
calcs = num1 + num2;
}
public static void main(String args[])
{
System.out.println(calcs);
}
}
The variable calcs should only calculate what is being given by num1 and num2. I forgot how to access that, if that's the error o.o.
Exception in thread "main" java.lang.RuntimeException: Uncompilable source code
at Methods.main(Methods.java:18)
Java Result: 1