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.spec;
- import com.spec.model.Holder;
- import com.spec.model.OldHolder;
- public class Main {
- public static void main(String[] args) {
- //
- OldHolder h = new OldHolder(10);
- h.setI(20);
- System.out.println("g.getI=" + h.getI());
- //Holder h2 = new Holder(10.20);
- // переменная h2 типа Holder<String>
- //
- Holder<String> h2 = new Holder<>("HELLO");
- String value = h2.getI();
- System.out.println("value=" + value);
- h2.setI("JAVA");
- Holder<Integer> h3 = new Holder<>(20);
- Integer i = h3.getI();
- h3.setI(20);
- }
- }
Add Comment
Please, Sign In to add comment