public static void main(String[] args) { Hebra h1, h2; MiVariable v = new MiVariable(0); h1 = new Hebra(v); h2 = new Hebra(v); h1.thr.start(); h2.thr.start(); try { h1.thr.join(); h2.thr.join(); } catch (InterruptedException ex) { } System.out.println(v.getValor()); }