|
所在平台: Udemy |
课程主页: https://www.udemy.com/course/java-exceptions-handling-assertion-java-logging-api/
课程评论:没有评论
课程名称: Java 异常处理、断言与 Java 日志 API 课程概述: 在 Java 语言和其他编程语言中,掌握如何处理应用程序中的错误是一项基本技能。Java 提供了一种灵活强大的方法,帮助您在遇到运行时异常时,仍能保持程序稳定运行。处理 Java 应用中的错误主要涉及异常处理、断言和日志记录。这些内容看似简单,但如果基础概念和技术掌握不清,可能会错误使用。 在异常处理模块中,我将引领您深入了解所有核心概念和重要技术,包括: - try-catch 块的基本用法 - 异常类型 - 何时使用 throws 和 throw 关键字 - finally 块 - 定位异常代码 - Java 7 中的新特性:捕获多个异常、try-with-resource - 创建自定义异常类 - 其他相关内容 您还将学习如何使用 assert 关键字,以及如何在代码中启用或禁用它。除了异常处理和断言,您还将学习如何使用 Java 日志 API 记录在程序执行过程中产生的信息。在这一部分,我将向您展示如何: - 以不同级别和处理器记录信息 - 创建自定义格式的自定义处理器:文本、HTML - 更改 JDK 中日志的默认设置 课程中提供了每个讲座的示例源代码。希望您享受这门课程,并在讨论区积极提问!
One of the fundamental skills in Java language as well as in other programming langues is to master how to handle errors in applications.Java provides a powerful and flexible way to help you in controlling your programs in a stable mode even in cases runtime exceptions occur.Handling errors in Java applications involves Exception Handling, Assertion, and Logging.Exceptions handling may sound simple but if you don't know fundamental concepts and techniques clearly, you may or may have been using it in the wrong way.In the Exception Handling section, I will walk you through all the core concepts and vital techniques, including:Basic usage of try-catch blockException typesWhen to use throws and throw keywordsThe finally blockLocating exceptions codeNew features in Java 7: catching multiple exceptions, try-with-resourceMake your own exception classes.And more coming.You will also learning how to use the assert keyword and enable/disable it in your code.Along with Exception Handling and Assertion, you will also learn how to record information which might generate during the program execution with the Java Logging API.In this section, I will show you how to:Record information with different levels and HandlersCreate your own custom handler with custom format: text, HTMLChange the default settings for logging in JDK.The course includes all the sample source code for each lecture.Hope you enjoy the course, and do not hesitate to ask questions in the discussion section if you have any.