Discussion Forum

Purpose of Static methos and variables

Purpose of Static methos and variables

by BHUWAN CHANDRA SAKLANI -
Number of replies: 1

What is the purpose of Static methods and static variables?

In reply to BHUWAN CHANDRA SAKLANI

Re: Purpose of Static methos and variables

by Ashutosh Bhatt -
A static method manipulates the static variables in a class. It belongs to the class instead of the class objects and can be invoked without using a class object. The static initialization blocks can only initialize the static instance variables. These blocks are only executed once when the class is loaded.