highlighted with try catch: unexpected token.
What could be the problem?
public class Class7 { String[] mas = new String[10]; try { System.out.println(" "); mas[10]=" "; } catch (ArrayIndexOutOfBoundsException e) { System.out.println("Выход за пределы массива"); } Class7(int length) { this.mas = new String[length]; } }
try/catchconstruct must be inside a method. - Igor