SlideShare a Scribd company logo
Java 7
New Features & Code Examples
Naresh Chintalcheru
Numeric Literals with Underscores

int thousand = 1_000;
int million = 1_000_000; //1000000 (one million)
double d1 = 1000_000_.0d
long a1 = 0b1000_1010_0010_1101_1010_0001_0100_0101L;

Imagine counting tens of zero’s ?. No need to strain
eyes or manual errors with Underscores
Bracket Notation for Collection
Old-Way
Collection<String> c = new ArrayList();
c.add(“one”);
c.add(“two”);
c.add(“ten”);
New-Way
Collection<String> c = new ArrayList {“one”, “two”, “ten”};
try-with-resource
Old-Way
BufferedReader br = null;

try {
br = new BufferedReader(new FileReader(path));
return br.readLine();
}catch(IOException ioEx) {}

finally {
try{
br.close();
}catch(IOException ioEx) {}
}
try-with-resource
• The File, JDBC, MQ, LDAP & Mail resource
connections will be opened & closed
• The finally block is used to make sure the
resources are closed
• Have another try-catch for closing the
resources
try-with-resource
New-Way
try (BufferedReader br = new BufferedReader(new FileReader(path));
BufferedWriter bw = new BufferedWriter(new FileWriter(path));

){
//File code
} catch(IOException ioEx) { }

With Java7 try-with-resource the resources
BufferedReader & BufferedWriter implements java.lang.
AutoCloseable and will be closed automatically
try-with-resource
New-Way
try (Statement stmt = con.createStatement()) {
ResultSet rs = stmt.executeQuery(query);
while (rs.next())
String coffeeName = rs.getString("Name”);

} catch (SQLException e) { }

With Java7 try-with-resource the resource javax.sql.
Statement implements java.lang.AutoCloseable and will
be closed automatically
Multi-Catch
Old-Way
try {
//statements
} catch (ExceptionOne ex) {
logger.error(ex);
throw ex;
} catch (ExceptionTwo ex) {
logger.error(ex);
throw ex;
} catch (ExceptionThree ex) {
logger.error(ex);
throw ex;
}
Multi-Catch
New-Way
try {
//statements
} catch (ExceptionOne | ExceptionTwo | ExceptionThree ex) {
logger.error(ex);
throw ex;
}

Clean code with multiple exceptions in one Catch
block
Final Rethrow
void process() throws IOException, SQLException
try {
//statements
} catch (final
throw ex;
}

Throwable ex) {

New precise rethrow feature which lets catch and
throw the base exception while still throwing the
precise exception from the calling method
String in Switch Statement
Finally ☺ ☺ ☺
String day;

switch (day) {
case "Monday":
break;
case "Tuesday":
case "Sunday":
typeOfDay = "Weekend";
break;
default:
throw new IllegalArgumentException("Invalid");
}

.
Simple Generic Instance
Old-Way
List<String> strings = new ArrayList<String>();
Map<String, List<String>> myMap = new HashMap<String, List<String>>();

New-Way (Simple)
List<String> strings = new ArrayList<>();
Map<String, List<String>> myMap = new HashMap<>();

.
Java.nio.file* (NIO2)
java.nio.file.Files
java.nio.file.Path
java.nio.file.Paths
Paths and Path - File locations/names
Files - Operations on file content
FileSystem – provides file services
File.toPath() method, Lets older code interact with
the new java.nio API
.
Create File Symbolic Link
java.nio.file.Files.createSymbolicLink()
createSymbolicLink() – creates a symbolic link, if
supported by the file system
public static Path createSymbolicLink(Path link, Path
target, FileAttribute<?>... attrs) throws IOException
.
Path, Files & Scanner
final static Charset ENCODING = StandardCharsets.UTF_8;
List<String> readFile(String aFileName) throws IOException {
Path path = Paths.get(aFileName);
return Files.readAllLines(path, ENCODING); //Read List
}
void readFile(String aFileName) throws IOException {
Path path = Paths.get(aFileName);
try (Scanner scanner = new Scanner(path, ENCODING.name())){
while (scanner.hasNextLine()){
log(scanner.nextLine());
//Read String Line
}
}}

.
Path & Files To Write
final static Charset ENCODING = StandardCharsets.UTF_8;

void writeFile(List<String> aLines, String aFileName) throws IOException {
Path path = Paths.get(aFileName);
Files.write(path, aLines, ENCODING); //Write using List
}
void writeFile(String aFileName, List<String> aLines) throws IOException {
Path path = Paths.get(aFileName);
try (BufferedWriter writer = Files.newBufferedWriter(path, ENCODING)){
for(String line : aLines){
writer.write(line);
//Write String line
writer.newLine();
}
}}.
File Change Notifications
File Change Notifications with WatchService APIs
private void watch() {
Path path = Paths.get("C:Temptemp");
try {
watchService = FileSystems.getDefault().newWatchService();
path.register(watchService, ENTRY_CREATE, ENTRY_DELETE,
} catch (IOException e) {
System.out.println("IOException"+ e.getMessage());
}
}

ENTRY_MODIFY);
Streaming & Channel-based I/O
• A stream is a contiguous sequence of data. Stream IO acts on
a single character at a time, while channel IO works with a
buffer for each operation.
• These are supported by the Files class and Buffered IO is
usually more efficient to be used in reading and writing data.
• The java.nio.channels package's ByteChannel interface is a
channel that can read and write bytes.
• The SeekableByteChannel interface extends the ByteChannel
interface to maintain a position within the channel. The
position can be changed using seek type random IO
operations.
Asynchronous Channel-based I/O
Support for Asynchronous channel-based I/O functionality
• AsynchronousFileChannel class is used for file manipulation
operations that need to be performed in an asynchronous manner,
the methods supporting the File write and read operations.
• AsynchronousChannelGroup class provides a means of grouping
asynchronous channels together in order to share resources.
• Java.nio.file package's SecureDirectoryStream class provides
support for more secure access to directories. However, the
underlying operating system must provide local support for this class.
URLClassLoader Closing

The URLClassLoader.close() method eliminates the
problem of supporting updated implementations of the
classes and resources loaded from a particular
codebase, and in particular from JAR files.
URLClassLoader Closing
URL url = new URL("file:foo.jar");
URLClassLoader loader = new URLClassLoader (new URL[] {url});
Class cl = Class.forName ("Foo", true, loader);
Runnable foo = (Runnable) cl.newInstance();
foo.run();
loader.close ();
// foo.jar gets updated somehow
loader = new URLClassLoader (new URL[] {url});
cl = Class.forName ("Foo", true, loader);
foo = (Runnable) cl.newInstance();
// run the new implementation of Foo
foo.run();

Eliminates Server restarts
JDBCRowSet
The RowSetFactory interface and the RowSetProvider class, which enable you to create
all types of row sets supported by the JDBC driver.
RowSetFactory myRowSetFactory = RowSetProvider.newFactory();
JdbcRowSet jdbcRs = myRowSetFactory.createJdbcRowSet();
jdbcRs.setUrl("jdbc:driver:myAttribute");
jdbcRs.setUsername(username);
jdbcRs.setPassword(password);
jdbcRs.setCommand("select * from Emp");
jdbcRs.execute();
jdbcRs.moveToInsertRow();
jdbcRs.updateInt(“AGE", 0);
jdbcRs.insertRow();
jdbcRs.last();
jdbcRs.deleteRow();
Varargs
public class VarArgsJavav6 {
public static void main(String[] args) {
vaMethod("a", "b", "c");
}
public void vaMethod(String... args) {
for(String s : args)
System.out.println(s);
}
}
Automatically treats Method parameter as an Array
JVM G1 Garbage Collector
• The Garbage-First (G1) garbage collector achieves high
performance and pause time goals through several
techniques
• The G1 collector is a server-style garbage collector,
targeted for multi-processor machines with large
memories
• Meets garbage collection (GC) pause time goals with
high probability, while achieving high throughput.
Dynamic Language Support
• Java is a static typed language to make it little bit more
dynamic (long way to go) similar to dynamic typed languages
like Ruby, Python & Clojure the new package java.lang.
invoke is introduced
• A new package java.lang.invoke includes classes
MethodHandle, CallSite and others, has been created to
extend the support of dynamic languages

.
Java 7 Performance
Improved String Performance
Improved Array Performance
Security Enhancements
Support for Non-Java Languages - invokedynamic
References
http://www.oracle.com/technetwork/java/javase/jdk7-relnotes-418459.html
http://radar.oreilly.com/2011/09/java7-features.html
http://www.slideshare.net/boulderjug/55-things-in-java-7
http://jaxenter.com/java-7-the-top-8-features-37156.html
http://stackoverflow.com/questions/2606620/what-are-the-new-features-in-java-7
http://tamanmohamed.blogspot.com/2012/06/jdk7-part-1-java-7-dolphin-newfeatures.html
http://tech.puredanger.com/java7/
Thank You

More Related Content

PDF
Java 7 New Features
PDF
Java 5 and 6 New Features
PPT
JDK1.6
PPT
55 New Features in Java 7
PPTX
New Features in JDK 8
PPTX
Whats New in Java 5, 6, & 7 (Webinar Presentation - June 2013)
DOCX
Advance Java Programs skeleton
PDF
Alternatives of JPA/Hibernate
Java 7 New Features
Java 5 and 6 New Features
JDK1.6
55 New Features in Java 7
New Features in JDK 8
Whats New in Java 5, 6, & 7 (Webinar Presentation - June 2013)
Advance Java Programs skeleton
Alternatives of JPA/Hibernate

What's hot (20)

PDF
Scala coated JVM
PDF
Java Concurrency by Example
PDF
JUnit5 and TestContainers
PDF
Sailing with Java 8 Streams
PDF
Productive Programming in Java 8 - with Lambdas and Streams
PDF
Scala @ TechMeetup Edinburgh
PDF
Functional Thinking - Programming with Lambdas in Java 8
PDF
Modern Programming in Java 8 - Lambdas, Streams and Date Time API
PPT
Hibernate
DOC
Ad java prac sol set
PPT
Mastering Java ByteCode
PDF
Lambda Functions in Java 8
PDF
Core Java - Quiz Questions - Bug Hunt
PPTX
Java 8 Feature Preview
PDF
Web注入+http漏洞等描述
PDF
Clojure for Java developers
PDF
Building node.js applications with Database Jones
PDF
Java Programming - 06 java file io
PPTX
A topology of memory leaks on the JVM
PDF
Smart Migration to JDK 8
Scala coated JVM
Java Concurrency by Example
JUnit5 and TestContainers
Sailing with Java 8 Streams
Productive Programming in Java 8 - with Lambdas and Streams
Scala @ TechMeetup Edinburgh
Functional Thinking - Programming with Lambdas in Java 8
Modern Programming in Java 8 - Lambdas, Streams and Date Time API
Hibernate
Ad java prac sol set
Mastering Java ByteCode
Lambda Functions in Java 8
Core Java - Quiz Questions - Bug Hunt
Java 8 Feature Preview
Web注入+http漏洞等描述
Clojure for Java developers
Building node.js applications with Database Jones
Java Programming - 06 java file io
A topology of memory leaks on the JVM
Smart Migration to JDK 8
Ad

Viewers also liked (19)

PDF
Asynchronous Processing in Java/JEE/Spring
PDF
Big Trends in Big Data
PDF
Lie Cheat & Steal to build Hyper-Fast Applications using Event-Driven Archite...
PDF
Introducing Java 7
PDF
3rd Generation Web Application Platforms
PDF
Object-Oriented Polymorphism Unleashed
PPTX
Spring 4 en spring data
PDF
Java EE 7 from an HTML5 Perspective, JavaLand 2015
ODP
Introduction to Spring Framework and Spring IoC
PDF
Get ready for spring 4
PDF
Top Java IDE keyboard shortcuts for Eclipse, IntelliJIDEA, NetBeans (report p...
PDF
Spring bean mod02
PDF
Webinar "Alfresco en une heure"
PDF
Mule ESB Fundamentals
PDF
AngularJS 101 - Everything you need to know to get started
PDF
Stateless authentication for microservices
PDF
Dockercon State of the Art in Microservices
PDF
Backday Xebia : Découvrez Spring Boot sur un cas pratique
KEY
Git Tours JUG 2010
Asynchronous Processing in Java/JEE/Spring
Big Trends in Big Data
Lie Cheat & Steal to build Hyper-Fast Applications using Event-Driven Archite...
Introducing Java 7
3rd Generation Web Application Platforms
Object-Oriented Polymorphism Unleashed
Spring 4 en spring data
Java EE 7 from an HTML5 Perspective, JavaLand 2015
Introduction to Spring Framework and Spring IoC
Get ready for spring 4
Top Java IDE keyboard shortcuts for Eclipse, IntelliJIDEA, NetBeans (report p...
Spring bean mod02
Webinar "Alfresco en une heure"
Mule ESB Fundamentals
AngularJS 101 - Everything you need to know to get started
Stateless authentication for microservices
Dockercon State of the Art in Microservices
Backday Xebia : Découvrez Spring Boot sur un cas pratique
Git Tours JUG 2010
Ad

Similar to Java7 New Features and Code Examples (20)

PPTX
PPTX
What is new in Java 8
PDF
wtf is in Java/JDK/wtf7?
PPTX
Java 7 Whats New(), Whats Next() from Oredev
PPT
Learning Java 1 – Introduction
PPTX
Lambda functions in java 8
PDF
55j7
ODP
From Java 6 to Java 7 reference
PDF
Scala in Places API
PPS
Advance Java
PPT
Corba
PPT
JDK1.7 features
PPTX
Java 7 & 8 New Features
PDF
Local data storage for mobile apps
PDF
Java 8 Workshop
PDF
RESTful Web Services with Jersey
PPT
Jug java7
PDF
Deeply Declarative Data Pipelines
PPT
比XML更好用的Java Annotation
PDF
FP in Java - Project Lambda and beyond
What is new in Java 8
wtf is in Java/JDK/wtf7?
Java 7 Whats New(), Whats Next() from Oredev
Learning Java 1 – Introduction
Lambda functions in java 8
55j7
From Java 6 to Java 7 reference
Scala in Places API
Advance Java
Corba
JDK1.7 features
Java 7 & 8 New Features
Local data storage for mobile apps
Java 8 Workshop
RESTful Web Services with Jersey
Jug java7
Deeply Declarative Data Pipelines
比XML更好用的Java Annotation
FP in Java - Project Lambda and beyond

More from Naresh Chintalcheru (10)

PDF
Cars.com Journey to AWS Cloud
PDF
Bimodal IT for Speed and Innovation
PDF
Reactive systems
PDF
Introduction to Node.js Platform
PDF
Problems opening SOA to the Online Web Applications
PDF
Design & Develop Batch Applications in Java/JEE
PDF
Building Next Generation Real-Time Web Applications using Websockets
PDF
Automation Testing using Selenium
PDF
Design & Development of Web Applications using SpringMVC
PDF
Android Platform Architecture
Cars.com Journey to AWS Cloud
Bimodal IT for Speed and Innovation
Reactive systems
Introduction to Node.js Platform
Problems opening SOA to the Online Web Applications
Design & Develop Batch Applications in Java/JEE
Building Next Generation Real-Time Web Applications using Websockets
Automation Testing using Selenium
Design & Development of Web Applications using SpringMVC
Android Platform Architecture

Recently uploaded (20)

PPT
Teaching material agriculture food technology
PDF
Review of recent advances in non-invasive hemoglobin estimation
PDF
AI And Its Effect On The Evolving IT Sector In Australia - Elevate
PDF
madgavkar20181017ppt McKinsey Presentation.pdf
PDF
Transforming Manufacturing operations through Intelligent Integrations
PDF
Blue Purple Modern Animated Computer Science Presentation.pdf.pdf
PDF
Empathic Computing: Creating Shared Understanding
PDF
Chapter 3 Spatial Domain Image Processing.pdf
PPTX
Telecom Fraud Prevention Guide | Hyperlink InfoSystem
PDF
Advanced IT Governance
PDF
Peak of Data & AI Encore- AI for Metadata and Smarter Workflows
PDF
How Onsite IT Support Drives Business Efficiency, Security, and Growth.pdf
PDF
CIFDAQ's Market Wrap: Ethereum Leads, Bitcoin Lags, Institutions Shift
PDF
cuic standard and advanced reporting.pdf
PDF
GamePlan Trading System Review: Professional Trader's Honest Take
PDF
Per capita expenditure prediction using model stacking based on satellite ima...
PPTX
MYSQL Presentation for SQL database connectivity
PDF
Dropbox Q2 2025 Financial Results & Investor Presentation
PDF
KodekX | Application Modernization Development
PDF
NewMind AI Weekly Chronicles - August'25 Week I
Teaching material agriculture food technology
Review of recent advances in non-invasive hemoglobin estimation
AI And Its Effect On The Evolving IT Sector In Australia - Elevate
madgavkar20181017ppt McKinsey Presentation.pdf
Transforming Manufacturing operations through Intelligent Integrations
Blue Purple Modern Animated Computer Science Presentation.pdf.pdf
Empathic Computing: Creating Shared Understanding
Chapter 3 Spatial Domain Image Processing.pdf
Telecom Fraud Prevention Guide | Hyperlink InfoSystem
Advanced IT Governance
Peak of Data & AI Encore- AI for Metadata and Smarter Workflows
How Onsite IT Support Drives Business Efficiency, Security, and Growth.pdf
CIFDAQ's Market Wrap: Ethereum Leads, Bitcoin Lags, Institutions Shift
cuic standard and advanced reporting.pdf
GamePlan Trading System Review: Professional Trader's Honest Take
Per capita expenditure prediction using model stacking based on satellite ima...
MYSQL Presentation for SQL database connectivity
Dropbox Q2 2025 Financial Results & Investor Presentation
KodekX | Application Modernization Development
NewMind AI Weekly Chronicles - August'25 Week I

Java7 New Features and Code Examples

  • 1. Java 7 New Features & Code Examples Naresh Chintalcheru
  • 2. Numeric Literals with Underscores int thousand = 1_000; int million = 1_000_000; //1000000 (one million) double d1 = 1000_000_.0d long a1 = 0b1000_1010_0010_1101_1010_0001_0100_0101L; Imagine counting tens of zero’s ?. No need to strain eyes or manual errors with Underscores
  • 3. Bracket Notation for Collection Old-Way Collection<String> c = new ArrayList(); c.add(“one”); c.add(“two”); c.add(“ten”); New-Way Collection<String> c = new ArrayList {“one”, “two”, “ten”};
  • 4. try-with-resource Old-Way BufferedReader br = null; try { br = new BufferedReader(new FileReader(path)); return br.readLine(); }catch(IOException ioEx) {} finally { try{ br.close(); }catch(IOException ioEx) {} }
  • 5. try-with-resource • The File, JDBC, MQ, LDAP & Mail resource connections will be opened & closed • The finally block is used to make sure the resources are closed • Have another try-catch for closing the resources
  • 6. try-with-resource New-Way try (BufferedReader br = new BufferedReader(new FileReader(path)); BufferedWriter bw = new BufferedWriter(new FileWriter(path)); ){ //File code } catch(IOException ioEx) { } With Java7 try-with-resource the resources BufferedReader & BufferedWriter implements java.lang. AutoCloseable and will be closed automatically
  • 7. try-with-resource New-Way try (Statement stmt = con.createStatement()) { ResultSet rs = stmt.executeQuery(query); while (rs.next()) String coffeeName = rs.getString("Name”); } catch (SQLException e) { } With Java7 try-with-resource the resource javax.sql. Statement implements java.lang.AutoCloseable and will be closed automatically
  • 8. Multi-Catch Old-Way try { //statements } catch (ExceptionOne ex) { logger.error(ex); throw ex; } catch (ExceptionTwo ex) { logger.error(ex); throw ex; } catch (ExceptionThree ex) { logger.error(ex); throw ex; }
  • 9. Multi-Catch New-Way try { //statements } catch (ExceptionOne | ExceptionTwo | ExceptionThree ex) { logger.error(ex); throw ex; } Clean code with multiple exceptions in one Catch block
  • 10. Final Rethrow void process() throws IOException, SQLException try { //statements } catch (final throw ex; } Throwable ex) { New precise rethrow feature which lets catch and throw the base exception while still throwing the precise exception from the calling method
  • 11. String in Switch Statement Finally ☺ ☺ ☺ String day; switch (day) { case "Monday": break; case "Tuesday": case "Sunday": typeOfDay = "Weekend"; break; default: throw new IllegalArgumentException("Invalid"); } .
  • 12. Simple Generic Instance Old-Way List<String> strings = new ArrayList<String>(); Map<String, List<String>> myMap = new HashMap<String, List<String>>(); New-Way (Simple) List<String> strings = new ArrayList<>(); Map<String, List<String>> myMap = new HashMap<>(); .
  • 13. Java.nio.file* (NIO2) java.nio.file.Files java.nio.file.Path java.nio.file.Paths Paths and Path - File locations/names Files - Operations on file content FileSystem – provides file services File.toPath() method, Lets older code interact with the new java.nio API .
  • 14. Create File Symbolic Link java.nio.file.Files.createSymbolicLink() createSymbolicLink() – creates a symbolic link, if supported by the file system public static Path createSymbolicLink(Path link, Path target, FileAttribute<?>... attrs) throws IOException .
  • 15. Path, Files & Scanner final static Charset ENCODING = StandardCharsets.UTF_8; List<String> readFile(String aFileName) throws IOException { Path path = Paths.get(aFileName); return Files.readAllLines(path, ENCODING); //Read List } void readFile(String aFileName) throws IOException { Path path = Paths.get(aFileName); try (Scanner scanner = new Scanner(path, ENCODING.name())){ while (scanner.hasNextLine()){ log(scanner.nextLine()); //Read String Line } }} .
  • 16. Path & Files To Write final static Charset ENCODING = StandardCharsets.UTF_8; void writeFile(List<String> aLines, String aFileName) throws IOException { Path path = Paths.get(aFileName); Files.write(path, aLines, ENCODING); //Write using List } void writeFile(String aFileName, List<String> aLines) throws IOException { Path path = Paths.get(aFileName); try (BufferedWriter writer = Files.newBufferedWriter(path, ENCODING)){ for(String line : aLines){ writer.write(line); //Write String line writer.newLine(); } }}.
  • 17. File Change Notifications File Change Notifications with WatchService APIs private void watch() { Path path = Paths.get("C:Temptemp"); try { watchService = FileSystems.getDefault().newWatchService(); path.register(watchService, ENTRY_CREATE, ENTRY_DELETE, } catch (IOException e) { System.out.println("IOException"+ e.getMessage()); } } ENTRY_MODIFY);
  • 18. Streaming & Channel-based I/O • A stream is a contiguous sequence of data. Stream IO acts on a single character at a time, while channel IO works with a buffer for each operation. • These are supported by the Files class and Buffered IO is usually more efficient to be used in reading and writing data. • The java.nio.channels package's ByteChannel interface is a channel that can read and write bytes. • The SeekableByteChannel interface extends the ByteChannel interface to maintain a position within the channel. The position can be changed using seek type random IO operations.
  • 19. Asynchronous Channel-based I/O Support for Asynchronous channel-based I/O functionality • AsynchronousFileChannel class is used for file manipulation operations that need to be performed in an asynchronous manner, the methods supporting the File write and read operations. • AsynchronousChannelGroup class provides a means of grouping asynchronous channels together in order to share resources. • Java.nio.file package's SecureDirectoryStream class provides support for more secure access to directories. However, the underlying operating system must provide local support for this class.
  • 20. URLClassLoader Closing The URLClassLoader.close() method eliminates the problem of supporting updated implementations of the classes and resources loaded from a particular codebase, and in particular from JAR files.
  • 21. URLClassLoader Closing URL url = new URL("file:foo.jar"); URLClassLoader loader = new URLClassLoader (new URL[] {url}); Class cl = Class.forName ("Foo", true, loader); Runnable foo = (Runnable) cl.newInstance(); foo.run(); loader.close (); // foo.jar gets updated somehow loader = new URLClassLoader (new URL[] {url}); cl = Class.forName ("Foo", true, loader); foo = (Runnable) cl.newInstance(); // run the new implementation of Foo foo.run(); Eliminates Server restarts
  • 22. JDBCRowSet The RowSetFactory interface and the RowSetProvider class, which enable you to create all types of row sets supported by the JDBC driver. RowSetFactory myRowSetFactory = RowSetProvider.newFactory(); JdbcRowSet jdbcRs = myRowSetFactory.createJdbcRowSet(); jdbcRs.setUrl("jdbc:driver:myAttribute"); jdbcRs.setUsername(username); jdbcRs.setPassword(password); jdbcRs.setCommand("select * from Emp"); jdbcRs.execute(); jdbcRs.moveToInsertRow(); jdbcRs.updateInt(“AGE", 0); jdbcRs.insertRow(); jdbcRs.last(); jdbcRs.deleteRow();
  • 23. Varargs public class VarArgsJavav6 { public static void main(String[] args) { vaMethod("a", "b", "c"); } public void vaMethod(String... args) { for(String s : args) System.out.println(s); } } Automatically treats Method parameter as an Array
  • 24. JVM G1 Garbage Collector • The Garbage-First (G1) garbage collector achieves high performance and pause time goals through several techniques • The G1 collector is a server-style garbage collector, targeted for multi-processor machines with large memories • Meets garbage collection (GC) pause time goals with high probability, while achieving high throughput.
  • 25. Dynamic Language Support • Java is a static typed language to make it little bit more dynamic (long way to go) similar to dynamic typed languages like Ruby, Python & Clojure the new package java.lang. invoke is introduced • A new package java.lang.invoke includes classes MethodHandle, CallSite and others, has been created to extend the support of dynamic languages .
  • 26. Java 7 Performance Improved String Performance Improved Array Performance Security Enhancements Support for Non-Java Languages - invokedynamic