Java SE 7 new features __java

Source: Internet
Author: User
Tags java se

Release Date: 2011-07-28

New changes:

1. String type can be used for switch statements
2. Supports binary constants, and can be delimited using underscores in numbers, for example, long creditcardnumber = 1234_5678_9012_3456l
3. Invocation of a simplified variable-length parameter method: The compiler reports a warning when a method that contains variable-length parameters uses an indeterminate array type. Now move the warning from the method call to the method declaration.
4. Improved type derivation for generic instance creation (<, that is, a diamond character: When you create a class instance, you use a restricted type deduction to explicitly declare the parameter types for the constructor, but you can determine those types from the context, and then replace the declaration with an empty type parameter setting. Therefore, in order to replace the following wording:
map<string, list<string>> anagrams = new hashmap<string, list<string>> ();
Can be written as:
map<string, list<string>> anagrams = new hashmap<> ();
5. Improved JVM support for dynamic languages.
Java SE 7 also introduces the latest bytecode structure, invokedynamic keywords, since Java began. Invokedynamic adds more than one invocation pattern and more than one link pattern, which can be programmed based on user-defined specifications. Its intention is to perform method calls efficiently and flexibly without static type information, which makes the performance of dynamic languages running on the JVM, such as JRuby and Jython, substantially improved.

Related Article

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.