Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- package com.company;
- import java.util.Random;
- import java.util.function.Supplier;
- public class Main {
- public static class HeavyBox {
- public int weight;
- public HeavyBox(int weight) {
- this.weight = weight;
- }
- }
- public static void main(String[] args) {
- Supplier <Integer> Ref = () -> {
- Random random = new Random();
- HeavyBox Box = new HeavyBox(random.nextInt(1000));
- return Box.weight;
- };
- System.out.println("Коробка случайного размера " +Ref.get());
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement