Skip to content

Latest commit

 

History

History

java8

Folders and files

NameName
Last commit message
Last commit date

parent directory

..
 
 
 
 
 
 
 
 

Version 8 (LTS) -2014-03

Usage from sdkman

  • sdk install java 8.0.302-open - install
  • sdk use java 8.0.302-open - use in current shell

Compact Profiles [JEP 161]

Lambda Expressions and the stream API [JEP 126]

Date & Time API - 🔗 java.time [JEP 150]

Described in [Java SE 8 for the really impatient] chapter 5.

All objects are immutable.

A few notes on date and datetime used in programming is found in Usage of Dates and Times in Networked Applications

  • Instant - a point in time.

  • Duration - a time based amount of time. The difference between two Instant's. See DurationTest for an example of measuring the duration of an operation.

  • Period - a date based amount of time. Use this when working with calendar days.

  • Types without time zone:

    • LocalDate - a date without a time. This stores a date like '2010-12-03' and could be used to store a birthday.
      LocalDate today = LocalDate.now();
      LocalDate someday = LocalDate.of(1969, Month.JULY, 16);
    • LocalTime - a time without a date. This stores a time like '11:30' and could be used to store an opening or closing time.
    • LocalDateTime - stores a date and time. This stores a date-time like '2010-12-03T11:30'.
  • ZonedDateTime - date time with time zones. Use this if you need to account for daylight changes.

  • java.time.temporal.TemporalAdjusters - static methods for returning different adjusters of dates. E.g. next(TUESDAY) or lastDayOfMonth. See examples in TemporalTest.

  • java.time.format.DateTimeFormatter - static formatters for formatting date and time. E.g. ISO_LOCAL_DATE. Specific instances can be created by using DateTimeFormatter.ofPattern("yyyy-MM-dd"). All DateTime objects has a format() and a parse() method that takes a DateTimeFormatter as argument.

  • java.time.chrono-package - calendar systems for other systems than the Gregorian calendar. Supported systems:

    • Hijrah calendar - the Islamic calendar
    • Japanese calendar
    • Minguo calendar - the calendar in Taiwan
    • Thai Buddhist calendar - the calendar in Thailand

    See ChronologyTest for an example of the current date in these calendars.

java.util.Base64 encoder and decoder

Base64 encoders and decoders for:

  • basic format (RFC 2045)
  • URL encoding (RFC 4648)
  • MIME encoding (line break every 76'th character)

See examples in Base64Test.

JNI - Statically linked libraries [JEP 178]

  • TODO

Project Nashorn - javascript runtime [JEP 174]

  • replaces Rhino
  • 🔗 javax.script
  • 🔗 jrunscript - command line script shell that supports multiple scripting languages
    • jrunscript -q - lists the supported script engines
    • supports both REPL mode and running of script files
  • deprecated in java 11

Garbage Collectors

  • removal of the Permanent Generation [JEP 122]

HotSpot Virtual Machine Garbage Collection Tuning Guide, release 8 (🔗 original link)