public class MainClass { public static void main(String[] argv) { MyClass myClass = new MyClass(); for (float f : myClass.localVariables) { System.out.println(f); } } } class MyClass { public float[] localVariables = new float[3]; public MyClass() { } }