Just a memo for me to remember the difference.
class Holder {
public static void sayHello() {
System.out.println("Hello, World!\n");
}
}
public class Foo {
public static void main (String [] args) {
Holder.sayHello();
Holder h1 = new Holder();
h1.sayHello();
}
}
#include <iostream>
#include <string>
using namespace std;
struct Holder {
public:
static void sayHello() {
cout << "Hello, World!\n";
}
};
int main(int argc, const char *argv[]) {
Holder::sayHello();
Holder h;
h.sayHello();
return 0;
}