Reputation: 117
My textbook says to "add multiple methods". But where on earth do I put the method?
I figured I should put it inside main but as soon as I put the public static void
part, there's an error!! And when I put a method outside of main, there's an error telling me "missing method body, or declare abstract".
What goes inside main and what goes OUT of main?
package testin;
public class Testin {
public static void printAmerican(String day, String month, int date, int year);{
day="Monday"
month="March"
date=14;
year=2017;
}
public static void main(String[] args) {
// TODO code application logic here
}
};
Upvotes: 0
Views: 55
Reputation: 45826
You have a semicolon in the wrong spot, before the {
:
(String day, String month, int date, int year);{...
// ^ Here
Get rid of that. It doesn't make any sense to have one there.
Upvotes: 1
Reputation: 31
Methods are declared WITHIN the class body.
public SomeClass {
private int someIntVariable = 0;
public method doSomeThingUseless(int myIntValue) {
someIntVariable = myIntValue;
}
}
Upvotes: 1