Java

Using Streams with Map in Java 8

Using Streams with Map in Java 8

Ashish Lahoti

Java 8 stream is widely used feature to write code in functional programming way. In this tutorial, we’ll discuss how to use Streams for Map creation, iteration and sorting.

All About Annotations in Java

All About Annotations in Java

Ashish Lahoti

In this tutorial, we’ll learn basics of Java Annotations, Built-in Java Annotations, How to create single-value, multi-value, repeated and type annotations and How to use them at runtime.

Ping Pong using Threads in Java

Ping Pong using Threads in Java

Ashish Lahoti

This problem is frequently asked in the interview to check your understanding on threads and your programming skills. Problem statement might change for e.g.

  • Print ping pong using two threads.
  • Print alternate number using two threads.
  • Print even numbers by one thread and odd numbers by another thread.