- Java 11 and 12:New Features
- Mala Gupta
- 115字
- 2021-07-02 12:26:59
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).
推薦閱讀
- Visual Studio 2012 Cookbook
- Android Jetpack開發:原理解析與應用實戰
- 零基礎學C++程序設計
- Responsive Web Design with HTML5 and CSS3
- Neo4j Essentials
- Python自然語言處理(微課版)
- 程序員修煉之道:通向務實的最高境界(第2版)
- Oracle JDeveloper 11gR2 Cookbook
- Getting Started with Gulp
- 智能手機故障檢測與維修從入門到精通
- Node.js從入門到精通
- Penetration Testing with the Bash shell
- Instant GLEW
- Java程序設計及應用開發
- Python程序設計教程