class Test { void f(boolean b){ String [] s; if (b) s = new String[]{"a"}; else s = new String[]{"c"}; } }