Issue with "void type not allowed here" and I cannot see why.
So I started my first Java class last week, and Ia m having problems. The question I have in my assignment is;
"Create an application named TestMethods whose main() methods holds two integer variables. Assign values to the variables. In turn, pass each value to methods named displayIt(), displayItTimesTwo(), and displatItPlusOneHundred(). Create each method to perform the task its name implies. Save the application as TestMethods.java."
So this is what I have so far...
public class TestMethods
public static void main(String args)
int myVariable1 = 10;
int myVariable2 = 27;
System.out.println(displayIt (myVariable1, myVariable2));
public static void displayIt(int myVariable1, int myVariable2)
System.out.println("My two variables are " + myVariable1 + " and " + myVariable2);
I keep getting "void type not allowed here" on line 16 which is bold. What am I doing wrong here? This is my first assignment, and it has been frustrating. I know it's an easy question, but I cannot get it in to code for the very first part. Any help is greatly appreciated.