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

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).

主站蜘蛛池模板: 丹江口市| 武定县| 澜沧| 洞口县| 兴宁市| 容城县| 铜川市| 祁东县| 巩义市| 牡丹江市| 皋兰县| 青岛市| 汕尾市| 渭源县| 璧山县| 若羌县| 根河市| 外汇| 东乡县| 宁蒗| 临城县| 芷江| 丰城市| 岳阳市| 宁强县| 汾西县| 上杭县| 登封市| 江口县| 若尔盖县| 云和县| 杭州市| 云安县| 天等县| 中方县| 安丘市| 德州市| 明水县| 府谷县| 罗江县| 广安市|