Does it matter if its like this:
public static void main(String[] args) {
sayHello()
}
static void sayHello() {
System.out.println("Wuz gud");
}
OR this:
static void sayHello() {
System.out.println("Wuz gud");
}
public static void main(String[] args) {
sayHello()
}
public class MyClass {
public static void main (String[] args) {
int x = 5;
addOneTo(x);
System.out.println(x);
}
static void addOneTo (int num) {
num++;
}
}
// Outputs “5”
Why is the output 5 and not 6?