• Complain

Reese - Java 8 New Features: A Practical Heads-Up Guide

Here you can read online Reese - Java 8 New Features: A Practical Heads-Up Guide full text of the book (entire story) in english for free. Download pdf and epub, get meaning, cover and reviews about this ebook. City: Los Gatos, year: 2014, publisher: P8tech;Smashwords Edition, genre: Computer. Description of the work, (preface) as well as reviews are available. Best literature library LitArk.com created for fans of good reading and offers a wide selection of genres:

Romance novel Science fiction Adventure Detective Science History Home and family Prose Art Politics Computer Non-fiction Religion Business Children Humor

Choose a favorite category and find really read worthwhile books. Enjoy immersion in the world of imagination, feel the emotions of the characters or learn something new for yourself, make an fascinating discovery.

Reese Java 8 New Features: A Practical Heads-Up Guide
  • Book:
    Java 8 New Features: A Practical Heads-Up Guide
  • Author:
  • Publisher:
    P8tech;Smashwords Edition
  • Genre:
  • Year:
    2014
  • City:
    Los Gatos
  • Rating:
    5 / 5
  • Favourites:
    Add to favourites
  • Your mark:
    • 100
    • 1
    • 2
    • 3
    • 4
    • 5

Java 8 New Features: A Practical Heads-Up Guide: summary, description and annotation

We offer to read an annotation, description, summary or preface (depends on what the author of the book "Java 8 New Features: A Practical Heads-Up Guide" wrote himself). If you haven't found the necessary information about the book — write in the comments, we will try to find it.

Are you are worried you are missing out on the latest version of Java? When you hear a term such as lambda expressions - do you wonder what you are neglecting? If so, Java 8 New Features will squash your concerns and deliver a quick and easy-to-understand guide to whats new in Java 8.The latest version of Java offers numerous improvements and new features to better utilize Java. Streams, for example, supports a fluent approach to problem solving and lets the developer take advantage of concurrency with minimal effort, whilst Lambda Expressions offer new ways of expressing a solution that brings efficiency and succinct programming.Get up-to-speed here!Java 8 New Features is a concise new book filled with code examples and best practice.In this book, you will:- Learn how interface enhancements - such as default methods - affect new additions to Java 8 and their impact on multiple inheritance between interfaces- Use lambda expressions to simplify solutions to development problems- Discover how the new Stream interface supports query type problems- Explore the new support for concurrent processing including that supported by Streams- Find out why the new date and time enhancements make working with time so much easier than it used to be- Includes information on the Nashorn JavaScript Engine, File IO Enhancements, and Project Jigsaw

Java 8 New Features: A Practical Heads-Up Guide — read online for free the complete book (whole text) full work

Below is the text of the book, divided by pages. System saving the place of the last page read, allows you to conveniently read the book "Java 8 New Features: A Practical Heads-Up Guide" online for free, without having to search again every time where you left off. Put a bookmark, and you can go to the page where you finished reading at any time.

Light

Font size:

Reset

Interval:

Bookmark:

Make
Java 8 New Features A Practical Heads-Up Guide - image 1
Java 8 New Features: Practical Heads-Up Guide [Smashwords Edition] Richard Reese Java 8 New Features A Practical Heads-Up Guide - image 2 * * * * * Published in 2014 by P8tech, an imprint of Play Technologies (England) Limited Copyright Play Technologies (England) Limited Richard Reese asserted their rights under the Copyright, Designs and Patents Act, 1988 to be identified as the author of this book. ISBN: 978-0-9929105-4-9 All Rights Reserved. No part of this publication may be reproduced, stored in a retrieval system, or transmitted in any form or by any means, electronic, mechanical, photocopying, recording or otherwise, without the prior permission of the publisher. This book is sold subject to the condition that it shall not, by way of trade or otherwise, be lent, re-sold, hired out or otherwise circulated without the publishers prior consent in any form of binding or cover other than that it which it is published and without a similar condition including this condition being imposed on the subsequent purchaser. P8tech has endeavoured to provide trademark information about all the companies and products mentioned in this book by the appropriate use of capitals. However, P8tech cannot guarantee the accuracy of this information.

Published by P8tech Limited
6 Woodside
Churnet View Road
Oakamoor
ST10 3AE
United Kingdom www.p8tech.com Cover image Shutterstock/Maks Narodenko * * * * * Table of Contents About The Author Richard Reese is an acclaimed author who has written several Java and C books, bringing a focused and easy-to-follow approach to learning. He currently teaches at Tarleton State University. Richard is currently working on a JMonkeyEngine title. * * * * * Code Examples Read Me You are reading an electronic version of this book. Some eReaders (and different screen widths) can do some quite funky reformatting to text, including stripping out indentations. To get your hands on the code as .txt, it is available as a freely downloadable file. To get your hands on the code as .txt, it is available as a freely downloadable file.

Download the file from the publisher page at: www.P8tech.com/java701 * * * * * Errata Despite best efforts, mistakes can sometimes creep into books. If you spot a mistake, please feel free to email us at errata@p8tech.com (with the book title in the subject line). The errata page for the book is hosted at www.P8tech.com/java702 * * * * * Chapter 1 Java 8 and Interface Enhancements Introduction to Java 8 -Default Methods and Functional Interfaces -Creating Default Methods -Understanding the Importance of Default Methods -Defining a Default Method --Overriding Default Methods -Using Inheritance with Default Methods --Working with Single Inheritance --Working with Multiple Inheritance --Understanding how Diamond Inheritance Works -Resolving Overridden Default Methods -Using Default Methods --Extending Existing Interfaces --Using Default Methods to Supplement Adapter Classes --Using Default Methods in Core Java Classes --Using a Class to Support Default Methods -Understanding the Difference between an Abstract Class and Interfaces -Using Static Interface Methods -Functional Interfaces --Creating a Functional Interface --Using the @FunctionalInterface Annotation --Overriding Object Class Methods in a Functional Interface --Using Functional Interfaces in the Core Libraries -Conclusion Introduction to Java 8 For Java to remain competitive it has to evolve. The enhancements to version 8 of Java introduce a number of new language features and packages. In this book we will examine most of these additions starting with an explanation of default methods and function interfaces. These new features, whilst useful in themselves, support other Java 8 features such as lambda expressions and stream.

Interfaces are the focus of the first chapter. One of the goals for Java 8 was to support and encourage the use of a functional style of programming. While this has not been completely achieved, the addition of lambda expressions certainly encourages this style. Lambda expressions are essentially anonymous functions. With Java 8 come a number of new function-like libraries designed to work with lambda expressions. Chapter 2 explores how to create and use these expressions.

Another goal of Java 8 is to provide better support for concurrent processing. Earlier techniques, while workable, can be error prone and hard to implement. The introduction of Streams to Java 8 moves some of the conceptual difficulties of concurrent programming away from the programmer and embeds them in streams. A stream can be thought of as a collection of elements to be processed either sequentially or concurrently. The programmer can specify what needs to be done and not worry about how it is done. In addition, there is support for internal iteration within the collection framework with the addition of the forEach method.

We will see many applications of streams in Chapter 3. Handling date and time has never been as clean as it could be in Java. This is rectified in Java 8 with the introduction of the java.time package and new classes to support time related tasks. The improvements introduced help make the execution of these tasks more readable and reliable. The formatting of time has also been improved. These enhancements are presented in Chapter 4.

There have been numerous other additions to Java. These will be discussed in Chapter 5. They range from virtual machine enhancements, which are not always readily visible to the typical programmer, to enhancements in how Java applications are annotated and documented. In addition, there are a few concurrency and character encoding updates. Also, the Nashorn JavaScript engine has been incorporated into Java which enables execution of JavaScript code from within a Java application. Default Methods and Functional Interfaces This chapter focuses on the various changes that have been made to interfaces and how they can be defined and used.

It starts out with a discussion of default methods. These types of methods are an important aspect of Java 8 as they lay the groundwork for other enhancements such as lambda expressions and streams. We cover how default expressions are created and used both in old applications and in new ones. Default methods are methods of an interface that have implementations. This means that classes that implement these types of interfaces do not have to implement default methods. Default methods have been added to existing interfaces such as those found in many collection classes.

Since classes that implement such interfaces do not need to override those methods, existing code that uses these interfaces will still work properly. As with earlier versions of Java, inheritance between interfaces is supported. However, default methods add a new dimension to inheritance and offer opportunities for overriding methods in both single and multiple inheritance situations. Functional interfaces are interfaces that possess one, and only one, abstract method. These types of interfaces are also called Single Abstract Methods (SAM). While an interface can possess default methods, it can have only one abstract method.

As demonstrated in Chapter 2, this type of interface provides the foundation for lambda expressions. Creating Default Methods Default methods are interface methods that have an implementation. They are declared using the default keyword. An example of a default method follows with a Drawable interface definition consisting of one default method and one abstract method: interface Drawable { public default void draw() { System.out.println( "The Drawable interface's draw method"); } public abstract boolean hasBeenDrawn(); } To illustrate the use of this interface we will use a Person class as defined - photo 3

Next page
Light

Font size:

Reset

Interval:

Bookmark:

Make

Similar books «Java 8 New Features: A Practical Heads-Up Guide»

Look at similar books to Java 8 New Features: A Practical Heads-Up Guide. We have selected literature similar in name and meaning in the hope of providing readers with more options to find new, interesting, not yet read works.


Reviews about «Java 8 New Features: A Practical Heads-Up Guide»

Discussion, reviews of the book Java 8 New Features: A Practical Heads-Up Guide and just readers' own opinions. Leave your comments, write what you think about the work, its meaning or the main characters. Specify what exactly you liked and what you didn't like, and why you think so.