01. New Features of Java1.5 and 01. New Features of Java1.5

Source: Internet
Author: User

01. New Features of Java1.5 and 01. New Features of Java1.5
I. Static Import

Import static methods and static variables in one class into another class

PackageJDK_New_Characters;

 

ImportStaticJava. lang. Math. *; // static import is equivalent to putting both static methods and static variables in Math

// StaticImport, so StaticImport can directly use these methods and variables

 

PublicClassStaticImport {

PublicStaticVoidMain (String [] args ){

System.Out. Println (Max(7, 8 ));

System.Out. Println (Random());

}

}

 

Ii. variable parameters

Iii. Enhanced for loop 4. Automatic unpacking and unpacking of basic data types 5. flyweight)

Objects that occupy a small amount of space and have the same attributes are simplified into one. different attributes are encapsulated as parameters of the method, which are called external States. The same attributes are called internal states. For example: the value range is [-128 ~ 127] Only One Integer object

Vi. enumeration (Enum) 1. function 2. Example 7. Annotations

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.