- 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).
推薦閱讀
- Learn ECMAScript(Second Edition)
- Google Apps Script for Beginners
- Python語言程序設計
- Magento 2 Theme Design(Second Edition)
- Getting Started with Python Data Analysis
- SQL Server 2016數據庫應用與開發
- R Data Analysis Cookbook(Second Edition)
- Apache Spark 2.x for Java Developers
- RabbitMQ Essentials
- Learning jQuery(Fourth Edition)
- TMS320LF240x芯片原理、設計及應用
- Java程序設計案例教程
- Laravel Design Patterns and Best Practices
- Isomorphic Go
- HTML5 Canvas核心技術:圖形、動畫與游戲開發