Java 8 Introduction

Java 8 is the major feature release of  Java Programming language .

Java 8 released in  March 18 , 2014.

Reference :

https://en.wikipedia.org/wiki/Java_version_history

With Java 8 Release . Java provided support for various new features as below.


  • Functional Programming
  • New API's for date time manipulation
  • New Java script engine
  • Streaming API's

Features of Java 8 :


Lambda Expression :

Added Functional processing capability to java. Which means treating functionality as a method argument or treating code as data.

Method References:

Treating functions as parameters .  Referencing functions with their names instead of  invoking or calling them directly.

Nashorn , Javascript Engine :

New java script engine to execute java Script Code.

Date Time API:


New set of packages added that provide additional features and functions.


Stream API:

The Stream API is integrated into the Collections API.

Stream API helps for bulk operations on collections . Like sequential or parallel map-reduce transformations.

Default Method:

Interfaces can have default methods . Default methods can be implemented.

Optional :

This feature is to handle null value properties.

Java FX , Security , Collections many other updates and improvements has been done for new version of Java 8 .

Reference :














Sorting - Introduction


In general in Computers more than 25% of run time is taken for sorting .

Sometimes  the Computing time for sorting is more than 50% for some installations.


- Above details mentioned by Donald  Kuth in The Art Of Computer Programming Vol 3







Top Ten Programming Languages In 2020

1. Python
2. Java
3. JavaScript
4. C and C++
5. Golang

6. R
7. Kotlin
8. C#

 9. Swift

10. PHP

Top 10 most Popular skills of 2020

1.  Python 

2. React (Web)

3. Angular


< 4. Machine Learning

5. Docker


< 6.Django

7. CompTia

8.Amazon AWS

9.Deep Learning


< 10.React Native(mobile)

Top Ten Technologies to Learn In 2020



Artificial Intelligence

5g

Cloud Computing

NLP and Voice Technology


< Block Chain

Internet Of Things

Quantum Computing

RPA

AR and VR 


< Wireless Power Transfer



LeetCode - Fizz Buzz

Write a program that outputs the string representation of numbers from 1 to n.
But for multiples of three it should output “Fizz” instead of the number and for the multiples of five output “Buzz”. For numbers which are multiples of both three and five output “FizzBuzz”.
Example:
n = 15,

Return:
[
    "1",
    "2",
    "Fizz",
    "4",
    "Buzz",
    "Fizz",
    "7",
    "8",
    "Fizz",
    "Buzz",
    "11",
    "Fizz",
    "13",
    "14",
    "FizzBuzz"
]
Java Solution :
class Solution {
    public List<String> fizzBuzz(int n) {
        List<String> resultList = new ArrayList<String>();
        for(int i = 1 ; i <= n ; i++){
            if(i%3 == 0 && i%5 == 0)
                resultList.add("FizzBuzz");
            else if(i%3 == 0)
                resultList.add("Fizz");
            else if(i%5==0)
                resultList.add("Buzz");
            else
                resultList.add(Integer.toString(i));
        }
            return resultList;
        }
    
}

LeetCode - Contains Duplicate

Given an array of integers, find if the array contains any duplicates.
Your function should return true if any value appears at least twice in the array, and it should return false if every element is distinct.
Example 1:
Input: [1,2,3,1]
Output: true
Example 2:
Input: [1,2,3,4]
Output: false
Example 3:
Input: [1,1,1,3,3,4,3,2,4,2]
Output: true
Java Solution :
class Solution {
    public boolean containsDuplicate(int[] nums) {
        HashSet<Integer> set = new HashSet<Integer>();
        for(int i : nums){
            if(set.contains(i))
                return true;
            else
                set.add(i);
        }
        return false;
    }
}

Featured Post

H1B Visa Stamping at US Consulate

  H1B Visa Stamping at US Consulate If you are outside of the US, you need to apply for US Visa at a US Consulate or a US Embassy and get H1...