ssd3 复习重点摘录

这篇博客摘录了Java SSD3复习的重点,包括导入包不影响编译或执行速度,System.in与BufferedReader结合用于输入,异常处理机制,Javadoc的使用,以及集合、继承、接口等概念的解释。还提到了调试器、文件I/O操作和单例模式的应用。

摘要生成于 C知道 ,由 DeepSeek-R1 满血版支持, 前往体验 >

个人在复习Java时候看ssd3觉得比较重要的摘录,基本上考试喜欢考这些点。

  1. importing a package does not slow compilation or execution, nor does it increase the size of the byte code.

  2. it is not necessary to import java.lang
    When programs produce screen output, it does not go directly to the screen. It goes to a holding area called a buffer. When the buffer is full, it is automatically flushed. Flushing empties the buffer and sends its contents to the screen

  3. System.in could be used for input directly. Its capabilities, however, are primitive as it can only read one character at a time. Reading a line of input this way would be cumbersome. Wrapping System.in in a BufferedReader object makes it possible to read entire lines of input. The BufferedReader method to read an entire line is readLine

  4. Exception handling is a mechanism that allows failures to be handled outside the normal flow of the code.

  5. When a method throws an exception, none of the remaining statements in that method are executed. If none of the methods in the call stack catch the exception and the top-most method is main, the program displays, in the standard error stream, a message that identifies the exception and terminates. To avoid premature termination of a program, you must include try-catch blocks that enable the program to recover from failures.

  6. The stack trace shows the sequence of methods that were called before the exception was thrown.

  7. Exception objects are instances of classes that descend from class Throwable. Throwable has two subclasses: Error and Exception.

  8. Class Error is used for serious problems from which an application is unlikely to recover. An example is the “out of memory” error.

  9. Class Exception is used for abnormal conditions that an application can be expected to `handled.
    在这里插入图片描述

  10. The Javadoc tag for an exception is the @throws tag—the @exception tag can also be used. The Javadoc comment for a method should have a @throws tag for each checked exception that the method might throw. It can also have @throws tags for unchecked exceptions but this is not necessary. The Javadoc comment should not have a @throws tag for exceptions that are caught and handled by the method.

  11. Javadoc comments open with a “slash-asterisk-asterisk” sequence ( /** ) and close with an “asterisk-slash” sequence ( */ ) on the same line or on separate lines.

  12. Common Javadoc Tags:
    @author – programmer’s name; used for classes
    @version – version of the program; used for classes
    @param – description of a formal parameter; used for methods and constructors
    @return – description of a return value; used for methods
    @exception (or @throws) – description of an exception; used for methods and constructors
    @see – reference to a related entity; used for classes, constructors, methods, and data fields

  13. A debugger is a convenient tool for locating the source of errors. A debugger allows you to execute one line at a time and observe the effect on the program’s variables.

  14. An associatio

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值