To go down to the website:
http://blog.csdn.net/samjustin1/article/details/52268004
Java7 new Features
You can use a string in 1.switch
String s = "Test"; Switch (s) {case "test": System.out.println ("test"); Case "Test1": System.out.println ("test1"); break; Default: System.out.println ("break"); break; }
2. Using list<string> templist = new arraylist<> (); Generic instantiation type auto-inference
3. The collection is syntactically supported, not necessarily an array
Final list<integer> List = [1,2,3,4,5,6]
4. New tools to access environmental information
File System.getjavaiotempdir ()//IO Temp folder file System.getjavahomedir ()//JRE installation directory file System.getuserhomedir ()///Current User directory File system.getuserdir ()//directory where the Java process was started 5
5,6,7 ...
Java8 new Features
1.Java 8 allows us to add a non-abstract method implementation to the interface, only need to use the default keyword, this feature is also called the extension method, the example is as follows:
Interface Formula { double calculate (int a); Default double sqrt (int a) { return math.sqrt (a); }
2.LAMBDA-expression
3. Function-Type interface
New features of Java7 and JAVA8