What is the point of a static method in a non-static class?

A static class means that you cannot use it in a non-static context, meaning that you cannot have an object instantiation of that class and call the method. If you wanted to use your print method you would have to do:

myOtherClass.print("vhhhat?");

This is not static, as you created an instantiation of the class called moc:

myOtherClass moc = new myOtherClass();

Leave a Comment

Hata!: SQLSTATE[HY000] [1045] Access denied for user 'divattrend_liink'@'localhost' (using password: YES)