Advertisement
sergAccount

Untitled

Aug 30th, 2020
1,491
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Java 1.02 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.spec;
  7.  
  8. import com.spec.model.Box;
  9. import com.spec.model.Holder;
  10. import com.spec.model.OldHolder;
  11.  
  12. public class Main {
  13.    
  14.     public static void main(String[] args) {
  15.         //
  16.         OldHolder h = new OldHolder(10);
  17.         h.setI(20);        
  18.         System.out.println("g.getI=" + h.getI());
  19.        
  20.         //Holder h2 = new Holder(10.20);
  21.        
  22.         // переменная h2 типа Holder<String>                
  23.         //
  24.         Holder<String> h2 = new Holder<>("HELLO");
  25.         String value = h2.getI();
  26.         System.out.println("value=" + value);        
  27.         h2.setI("JAVA");
  28.        
  29.         Holder<Integer> h3 = new Holder<>(20);  
  30.         Integer i = h3.getI();
  31.         h3.setI(20);      
  32.        
  33.         Box<String, Integer> b = new Box<>("TEST", 20);
  34.        
  35.     }    
  36. }
  37.  
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement