Giter Club home page Giter Club logo

java8-demos's Introduction

java8-demos

Lambdas

  • Lambdas are syntax for the Functional programming in Java
  • Functional programming is separating data and behaviour
  • Functional programming is a new approach to the programming
  • With Lamdas ,Java is Now Object Oriented,Functional programming language
  • Lambdas are not part of the Compiler.They are interpretaed in the JVM/JRE

Date TIME API

  • LocalDate
  • LocalTime
  • LocalDateTime
  • Duration
  • Period
  • ZoneIds -TemporalAdjusters

Streams

  • Follows Map/Filter/Reduce Alogirthms
  • Stream is a declartion
  • Stream can be consumed only once
  • Map and Filter operations generate Intermediate Streams
  • Reduce does the comuting

Optional Usage

  • Replace null with Optional.Empty;
    • Ex: Person p=null; Person p=Optional.Empty
  • Ways to create Optional
    • From Empty
      • Optional myval=Optional.empty();
    • From Non Nullable
      • Optional myval = Optional.of("test");
    • From Nullable
      • Optional optCar = Optional.ofNullable(car);
  • Use Otopnal.isPresent to check the prescence of a value
  • Use orElse orElseThrow to deviate when empty value is there

String Changes

- String has the Support of IntStream for Operations
- StringJoiner is added to the Kitty to meet all needs of String Concatenation
- Forget String Buffer and String Builder from Java8
- Ex:
    - StringJoiner sj=new StringJoiner(",","{","}");//First one is the Delimiter for concatenation floowed by Prefix and post fix
	- String finalString=sj.add("one").add("two").add("Three").toString();
	- System.out.println(finalString);
	- Output:
	  - {one,two,Three}

Miscelanious

- Map enhancements with putIfAbsent,ComputeIfAbsent etc
- Java NIO Streams Support

BASE64 Support for Encryption

- Support for Plain Text ,URLS and Mime type is added
- Ex: Base64.Encoder encoder = Base64.getEncoder();

java8-demos's People

Contributors

narasimhavuppala avatar preethamreddyboddu avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.