public class PruebaStatic { public static void main(String[] args) { Factura f = new Factura(); f.preciosProductos = new int[]{100,50,120}; Factura.setIva1(10.f); Factura.setIva2(5.f); } } class Factura{ private static float iva1; private static float iva2; int [] preciosProductos; public static float getIva1() { //preciosProductos[2]=3;error: non-static variable preciosProductos cannot be referenced from a static context return iva1; } public static float getIva2() { return iva2; } public static void setIva1(float iva1) { Factura.iva1 = iva1; } public static void setIva2(float iva2) { Factura.iva2 = iva2; } }