Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- /*
- * To change this license header, choose License Headers in Project Properties.
- * To change this template file, choose Tools | Templates
- * and open the template in the editor.
- */
- package com.mycompany.ja11;
- /**
- *
- * @author Admin
- */
- public class Main {
- public static void main(String[] args) {
- // Holder<T> h;
- Holder<String> h1;
- Holder<Integer> h2;
- // ..
- Holder<Person> h3;
- // создаем объект типа Holder
- Holder<Person> h4 = new Holder<>(new Person());
- Person p1 = h4.getObj();
- Holder<String> h5 = new Holder<>();
- String p5 = h5.getObj();
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement