Java 19120 Code review changes (#13747)
* JAVA-19120 Move article Lambda Expression vs. Anonymous Inner Class to core-java-8-2 module --------- Co-authored-by: Anastasios Ioannidis <121166333+anastasiosioannidis@users.noreply.github.com>
This commit is contained in:
@@ -11,5 +11,6 @@ This module contains articles about Java 8 core features
|
||||
- [Convert Between Byte Array and UUID in Java](https://www.baeldung.com/java-byte-array-to-uuid)
|
||||
- [Create a Simple “Rock-Paper-Scissors” Game in Java](https://www.baeldung.com/java-rock-paper-scissors)
|
||||
- [VarArgs vs Array Input Parameters in Java](https://www.baeldung.com/varargs-vs-array)
|
||||
- [Lambda Expression vs. Anonymous Inner Class](https://www.baeldung.com/java-lambdas-vs-anonymous-class)
|
||||
- [Java Helper vs. Utility Classes](https://www.baeldung.com/java-helper-vs-utility-classes)
|
||||
- [[<-- Prev]](/core-java-modules/core-java-8)
|
||||
|
||||
@@ -0,0 +1,14 @@
|
||||
package com.baeldung.anonymousclass;
|
||||
|
||||
public class AnonymousClassExample{
|
||||
|
||||
public static void main(String[] args){
|
||||
Thread t1 = new Thread(new Runnable(){
|
||||
@Override
|
||||
public void run() {
|
||||
System.out.println("Thread: "+Thread.currentThread().getName()+" started");
|
||||
}
|
||||
});
|
||||
t1.start();
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,9 @@
|
||||
package com.baeldung.lambdaexpression;
|
||||
|
||||
public class LambdaExpressionExample{
|
||||
|
||||
public static void main(String[] args){
|
||||
Thread t1 = new Thread(()->System.out.println("Thread: "+Thread.currentThread().getName()+" started"));
|
||||
t1.start();
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user