Image for post
Image for post

Java 9 Features

- Immutable List

List.of(1,2,3);
  • Cannot add null value, it will throw NullPointerException.
  • Cannot add more values to the list, it will throw UnsupportedOperationException.
  • Can add values only at the time of initialization.

- Immutable Set

Set.of(1,2,3);
  • Cannot add duplicate values like Set.of(1,1,2), it will throw IllegalArgumentException.
  • Cannot add null value, it will throw NullPointerException.
  • Cannot add more values to the set, it will throw UnsupportedOperationException.
  • Can add values only at the time of initialization.

- Immutable Map

Map.of(K1,V1,K2,V2);      // K refers to key and V refers to value


Image for post
Image for post

1. Creating list: toList()

List<Integer> integers = Arrays.asList(1,2,3,4,5,6,6);integers.stream().map(x -> x*x).collect(Collectors.toList());// output: [1,4,9,16,25,36,36]

2. Creating set: toSet()

List<Integer> integers = Arrays.asList(1,2,3,4,5,6,6);integers.stream().map(x -> x*x).collect(Collectors.toSet());// output: [1,4,9,16,25,36]

3. Creating specific collection: toCollection()


Image for post
Image for post

Stashing in GIT


Image for post
Image for post

Creating react application

npx create-react-app my-app
cd my-app
npm install


Image for post
Image for post

What are a docker image and docker container?

Breakdown of docker commands syntax:

1. Keyword 'docker'
2. Main task (start, stop, build, etc).
3. Options (port, tty, interactive volumes, etc).
4. Reference to image or container with all the property flags.


Image for post
Image for post

ECMAScript6 -ECMAScript 2015

Features introduced in EC6

let keyword

var x = 10;
{
let x = 2;
let x = 4; // ERROR (cant redeclare)
x = 5; // works fine
// In this block x is equal to 5
}
// here x is 10

const keyword


Image for post
Image for post

Dependencies

        <dependency>
<groupId>io.quarkus</groupId>
<artifactId>quarkus-hibernate-orm-panache</artifactId>
</dependency>
<dependency>
<groupId>io.quarkus</groupId>
<artifactId>quarkus-jdbc-postgresql</artifactId>
</dependency>
<dependency>
<groupId>io.quarkus</groupId>
<artifactId>quarkus-hibernate-validator</artifactId>
</dependency>

Configuration


Image for post
Image for post

Quarkus vs Spring boot

1. Start-up time :


Asynchronous programming is a programming paradigm that facilitates fast and responsive user interfaces. The asynchronous programming model in Java provides a consistent programming model to write programs that support asynchrony.

Image for post
Image for post

Why Asynchronous programming

Spring webFlux module


Image for post
Image for post
function hoist() {
a = 20;
var b = 100;
}

console.log(a); // error a is not defined

hoist();

console.log(a); // 20 a becomes global variable
console.log(b); …

About

Rohan Aggarwal

Full stack developer

Get the Medium app

A button that says 'Download on the App Store', and if clicked it will lead you to the iOS App store
A button that says 'Get it on, Google Play', and if clicked it will lead you to the Google Play store