You need access to object of that other class - in other words 'reference' (in your example class1)
var c1 = new class1();
then you can access it's members
var alpha = c1.alpha;
Depending on your project you can instantiate it inside class2 or pass it as a parameter to class2 constructor.
What you did here probably would work in JAVA.