Ning2018 / JavaFundamentals

0 stars 0 forks source link

static and non static method #2

Open Ning2018 opened 6 years ago

Ning2018 commented 6 years ago

From multiple resources: 'Static’ tells the complier, that this block's memory should allocate outside class object’s memory. Means, when you call 'New' for a class, this particular block will be excluded.

Static methods can be called without the instance of any class. Non-static methods should be called by using the instance of class. ( ClassName instanceName = new ClassName() instanceName.methodName(args);)