package com.vinod.test;
public class Java8ThreadExample {
public static void main(String[] args) {
Thread t1 = new Thread(Java8ThreadExample::printJob);
Thread t2 = new Thread(Java8ThreadExample::printJob);
t1.start();
t2.start();
}
public static void printJob() {
for (int i = 1; i <= 15; i++) {
System.out.println(Thread.currentThread()+"printing" + i);
}
}
}
Keep Traveling
Java 8 Method Reference example
Subscribe to:
Post Comments (Atom)
Featured Post
Confusion Matrix + Precision/Recall (Super Simple, With Examples)
Confusion Matrix + Precision/Recall (Super Simple, With Examples) 1) Binary Classification Setup Binary classification means the model p...
Featured Posts
-
In this example we will see how do to the file encryption and decryption using Apache Camel using pgp 1. Generate pgp keys In order to do t...
-
Spring provides a JMS integration framework that simplifies the use of the JMS API, the JmsTemplate class is the core class which is availab...
-
The selective consumer is consumer that applies a filter to incoming messages so that only messages meeting that specific selection criteria...
-
Apache camel API has the inbuilt kafka component and it is very simple to create producer, consumer and process messages. Here is one simple...
-
Apache camel provides intercepting feature while Exchanges are on route. Camel supports three types for interceptors ( See more about Camel ...
-
Maven Error Notes [ERROR] Failed to execute goal org.apache.maven.plugins:maven-compiler-plugin:2.5.1:compile (default-compile) on projec...
-
In the previous example ( Mocking Static methods ) we created mock values for Static methods, in this example we will see how to mock new in...
-
☸️ Helm vs Kubectl — What, Why, and When to Use Each If you work with Kubernetes, you will almost always use both kubectl and Helm — bu...
-
🔢 Java Sorting Algorithms — Step-by-Step with Iterations Sorting is a fundamental concept in programming and data structures. Below are t...
-
Itext PDF is an open source API that allows to create and modify pdf documents in java. In this example we will see how to create and and i...
No comments:
Post a Comment