Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- public class ThreadTest {
- public static void main(String[] args) {
- Runnable r1 = new Runnable() { // Anonimna klasa
- @Override
- public void run() {
- System.out.println("Using Anonymous class");
- }
- };
- Runnable r2 = () -> { // Lambda izraz
- System.out.println("Using Lambda Expression");
- };
- new Thread(r1).start();
- new Thread(r2).start();
- }
- }
Add Comment
Please, Sign In to add comment