DZone
Thanks for visiting DZone today,
Edit Profile
  • Manage Email Subscriptions
  • How to Post to DZone
  • Article Submission Guidelines
Sign Out View Profile
  • Post an Article
  • Manage My Drafts
Over 2 million developers have joined DZone.
Log In / Join
Refcards Trend Reports Events Over 2 million developers have joined DZone. Join Today! Thanks for visiting DZone today,
Edit Profile Manage Email Subscriptions Moderation Admin Console How to Post to DZone Article Submission Guidelines
View Profile
Sign Out
Refcards
Trend Reports
Events
Zones
Culture and Methodologies Agile Career Development Methodologies Team Management
Data Engineering AI/ML Big Data Data Databases IoT
Software Design and Architecture Cloud Architecture Containers Integration Microservices Performance Security
Coding Frameworks Java JavaScript Languages Tools
Testing, Deployment, and Maintenance Deployment DevOps and CI/CD Maintenance Monitoring and Observability Testing, Tools, and Frameworks
Culture and Methodologies
Agile Career Development Methodologies Team Management
Data Engineering
AI/ML Big Data Data Databases IoT
Software Design and Architecture
Cloud Architecture Containers Integration Microservices Performance Security
Coding
Frameworks Java JavaScript Languages Tools
Testing, Deployment, and Maintenance
Deployment DevOps and CI/CD Maintenance Monitoring and Observability Testing, Tools, and Frameworks
  1. DZone
  2. Data Engineering
  3. Databases
  4. Various API and Language Enhancements as Part of Java 7

Various API and Language Enhancements as Part of Java 7

Mohamed Sanaulla user avatar by
Mohamed Sanaulla
CORE ·
Jul. 18, 12 · Interview
Like (0)
Save
Tweet
Share
5.38K Views

Join the DZone community and get the full member experience.

Join For Free

I believe most of the Java Developers are aware of the latest Java release i.e Java 7. Lot of us are disappointed about quite a few important features being deferred to Java 8, but its really good to see the language evolving and lot of things happening in the Java community. You must have seen plethora of articles on try-with-resources, strings in switch statements and other minor language enhancements as part of Project Coin. These are just few of the enhancements added to the release. There are few other API enhancements which are good to know, for example new Files API in java.nio package, watching directory changes, Fork-Join framework.

I went through few of those topics and blogged about them and I thought it is best to aggregate them here for the benefit of the readers.

Fork-Join Framework:

In Java 5 java.util.concurrent package was added with lot of new classes for developing concurrent applications- Executor, ExecutorService, Callable, Futures among others. Fork-Join framework was added in Java 7 which builds on top of ExecutorService and adds task stealing algorithm in which the tasks queued in one thread can be picked by ideal threads and this facilitates creating multiple tasks and not worrying about tasks not getting executed.

  • A brief overview of Fork-Join framework can be found here.
  • Implementing mergesort algorithm using ForkJoin framework can be found here.

Enhancements to the File API:

A new package java.nio.file was added with support for representing file path, a static Files utility for reading, writing to a file and other file related tasks, working with symbolic links, api for implementing watch service and others.

  • Implementing WacthServie API in Java 7 to monitor directory changes.
  • A peek into the Files utility which is part of java.nio package in Java 7.
  • Creating, Writing, Reading files using Java Files API of Java 7.

There was another utility added to java.util package- Objects class with static utility methods for operating on object references. This is kind of unknown addition but has been used extensively in the Java 8 APIs. And I came across this while reading through the Java 8 code.

One other important feature added to the JVM- invokedynamic has been missed out here. And I think its quite important to explore this feature for there are languages like Groovy 2.0, JRuby making use of this feature.

API Java (programming language)

Published at DZone with permission of Mohamed Sanaulla, DZone MVB. See the original article here.

Opinions expressed by DZone contributors are their own.

Popular on DZone

  • Agile Scrum and the New Way of Work in 2023
  • How To Use Terraform to Provision an AWS EC2 Instance
  • Top 12 Technical Skills Every Software Tester Must Have
  • GitOps: Flux vs Argo CD

Comments

Partner Resources

X

ABOUT US

  • About DZone
  • Send feedback
  • Careers
  • Sitemap

ADVERTISE

  • Advertise with DZone

CONTRIBUTE ON DZONE

  • Article Submission Guidelines
  • Become a Contributor
  • Visit the Writers' Zone

LEGAL

  • Terms of Service
  • Privacy Policy

CONTACT US

  • 600 Park Offices Drive
  • Suite 300
  • Durham, NC 27709
  • support@dzone.com
  • +1 (919) 678-0300

Let's be friends: