You have no "basic" methods. All methods are a class method, the only difference is that the "static" methods (vg, main) do not need to create a new object (via the "new" one) to use them.
In other words:
public class MyClass { public static void myStaticMethod() { } public void myInstanceMethod() { } }
You can do
MyClass.myStaticMethod()
but to use myInstanceMethod you have to create an object
(new MyClass).myInstanceMethod;
Usually you do the last as
MyClass myObject = new MyClass(); myObject.myInstanceMethod();
Please note that you can also do
myObject.myStaticMethod();
but this is exactly the same as doing
myClass.myStaticMethod();
and the first method is considered bad style and usually causes a compiler warning.
@Miranda, because only with the help of static methods you lose the whole object-oriented part, and you just end using Java, since you would use regular C.
In an object, you have both state and methods. In a class, you save both the state of the object and the methods. For example, you can usually create a class "Card", create a card "New card" ("K", "Sheet") "and have methods for processing it (" uncoverCard () ").
As soon as you have a reference to the object you want, you use its methods, and you know that you affect only this object, and that you are using the correct version of the method (because you are using the method specific to this very class).
Switching to OO programming from procedural programming may seem tricky at the beginning. Keep trying, looking at the training code and asking for advice when necessary, and you will soon realize this.