The path of Java Programmer's cultivation

Source: Internet
Author: User

Part I: Development with JAVA7
Chapter One: Primary knowledge JAVA7
1.1 Languages and Platforms Java Language Specification (JLP), JVM specification (VMSPEC)
1.2Coin Project: Concentrate is the essence
Modification process: 1. Update JLS
2. Implement a prototype in the source compiler
3. Add the necessary class library support for the modifications
4. Writing Tests and use cases
5. Update the document
If the modification touches the VM or platform, you also need to
1. Update Vmspec
2. Implementing changes to the VM
3. Add support in class files and VM Tools
4. Consider the impact on reflection
5. Consider the impact on serialization
6. Think about the impact on local components, such as the Java Local interface (JNI)
Note: Modifying the type system is a dangerous self-seeking idea
Modification of the 1.3Coin project
String support in 1.3.1 switch
The switch supports Byte, char, short, and int and enumeration constants before Java6.
Java7 added to string support after
1.3.2 A stronger numerical text representation
1. Numeric constants (such as integers in the base type) can be represented by binary
2. Underline can be used in integral type constants to improve readability
Good for the system bottom programmer, especially for the original network protocol, encryption, processing bits of programmers
Java6 before handling binary: int x=integer.parseint ("1100110", 2);
Java7 int x=1100110;
Numbers too long, easy to dazzle, reference Ruby, add underline
"_" will be removed if int x=1000_000_000 is compiled
Abnormal handling after 1.3.3 improvement
Supports multiple exceptions to work with Java7:catch (ioexception| nullpointerexception| FileNotFoundException e) {}
Exception throw Java7:catch (Final IOException e) {throw e;}
1.3.4try-with-resources (TWR)
Note: This modification is implemented by the compiler
Try (FileInputStream fin=new fileinputstream ("Somefile.bin");
ObjectInputStream in=new ObjectInputStream (Fin)) {//...}
Instead of manually shutting down resources here, all resource classes implement AutoClose (), which means that all classes are subject to modification! Recommended for use in resource-related classes!
1.3.5 Masonry Grammar
Java6:map<integer,map<string,string>> user=new hashmap<integer,map<string,string>> ();
Java7:map<integer,map<string,string>> user=new HashMap ();
Compiler level Modification!
1.3.6 some possible modifications to the type of warning are transferred to the API provider instead of the API consumer @safevarargs
Chapter II: New I/O

Java Programmer's Way of practicing

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.