in the static get () method, you create a new object of class A, after which it is possible to access non-static members of class A through a newly created object. Ie, in the get method, you create a temporary object, which is destroyed immediately after the fulfillment of its responsibility to change the variable a.
Ie you have a class:
public class SomeClass { static Class nameclass = new Class(); // Статический - значит общий объект для всех экземпляров SomeClass будь их хоть тысяча, все равно оги будут иметь общее поле nameclass, да и при отсутствии объектов SomeClass nameclass все равно существует ... // другие методы и поля } /*где-то внутри другого класа вы можете обратиться к nameclass без создания объекта SomeClass(одно из применений static)*/ SomeClass.nameclass.someMethodOfClass(); // Создаем 2 объекта класса SomeClass ob1 = new SomeClass(); ob2 = new SomeClass(); // Предположим у класса Class есть поле someValue равное 0 на данный момент ob1.nameclass.someValue = 100500; System.out.println(ob2.nameclass.someValue); // выведет 100500, а если бы nameclass был не статический, мы получили бы 0
This is the second use of static: for ob1 and ob2 nameclass is a common variable, changes in which from one object are immediately visible from another.