Advertisement
sergAccount

Untitled

Feb 14th, 2021
570
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Java 0.73 KB | None | 0 0
  1. /*
  2.  * To change this license header, choose License Headers in Project Properties.
  3.  * To change this template file, choose Tools | Templates
  4.  * and open the template in the editor.
  5.  */
  6. package com.mycompany.ja13;
  7.  
  8. public class Main {
  9.    
  10.     public static void main(String[] args) {
  11.         Calculator с = null;
  12.        
  13.         Calculator c2 = new CalculatorImpl();
  14.         c2.calc(10, 20);
  15.         // нет необходимости создавать отдельный класс
  16.         Calculator c3 = (a, b) -> {return a + b;};
  17.         int res = c3.calc(20, 20);
  18.         System.out.println("res=" + res);
  19.        
  20.         Runnable r = () -> {System.out.println("HELLO");};
  21.         r.run();        
  22.     }
  23.    
  24. }
  25.  
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement