官术网_书友最值得收藏!

Code check – part 1

One of our programmers, Aarav, refactored some code by his team member, Pavni. The code no longer provides char and the corresponding ASCII numbers of the values stored by the char array. Can you help Aarav? The following is the code to use:

class Foo {   
    public static void main(String args[]) {   
        try {   
           char[] name = new char[]{'S','t','r','i','n','g'};   
           for (var c : name) {   
               System.out.println(c + ":"   + (c + 1 - 1));   
           }   
        }   
        catch (var e) {   
            //code   
        }   
    }   
}   

The answer to the code check: The var type can't be used to specify the types of exceptions in the catch handler, (var e).

主站蜘蛛池模板: 偃师市| 靖远县| 辛集市| 重庆市| 三原县| 米林县| 平阳县| 徐闻县| 绿春县| 东光县| 舒城县| 来安县| 吉首市| 准格尔旗| 谷城县| 绥宁县| 石渠县| 宣化县| 武城县| 体育| 松潘县| 资阳市| 平潭县| 白银市| 浮梁县| 寻甸| 论坛| 灌南县| 贵定县| 巢湖市| 祁连县| 永宁县| 南昌市| 盈江县| 泸西县| 汶上县| 昆山市| 罗江县| 大洼县| 泸水县| 大方县|