0
What's the difference?
I'm not understanding how this is any different than the following: class MyClass { public static void main(String[] args) { System.out.println("Hello World!"); } } // they both execute Hello World! when they're run.
5 Antworten
+ 1
So sorry! In hindsight I realize that my post didn't link to the original code. Here's the original code for context:
class MyClass {
static void sayHello() {
System.out.println("Hello World!");
}
public static void main(String[ ] args) {
sayHello();
}
}
// Outputs "Hello World!"
It was under Java > Classes and Objects > Methods
+ 1
Thanks! After reading I realize I need to learn the fundamentals; the "why's" of coding. I appreciate your quick response!