Implementing object-Oriented Programming with Java (6)

Source: Internet
Author: User
Tags finally block try catch

No (5)

NullPointerException NULL pointer exception (a method is called by an empty object)

Abnormal:
Try block: A block of code that may have an exception is not allowed to be missing and is not allowed to exist separately (can be combined with a catch finally block using the preceding 2 to show any accesses than either)
Catch block: Handling exceptions thrown in a try block
Finally block: The code will execute anyway

Throw: Using the throw new Exception ("Extra information Content"), which exists in the method, indicates that the method is likely to throw an exception, hoping that the caller will catch it instead of handling the problem by itself

Throws: The keyword appears on the method header, if a throw new Exception ("Extra information content") appears inside the method, indicating that the method is likely to throw an exception and need to be declared

Run-time exception: Do not need to be forced by the program to scratch the try Catch block
Checked exception: The caller must be required to add a try catch block or the program will not compile through


Log4j
1. Introduction of Log4j.jar-->bulid path--"Add Library"
2. Create a Log4j.properties file note the file name note the path to where the files are placed

8 Basic data types for 8 types of packaging
int Integer
Long Long
Short Short
BYTE byte
float float
Double Double
Char Character
Boolean Boolean

Automatic conversion between wrapper type and basic type when jdk1.5 version

Implementing object-Oriented Programming with Java (6)

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.