Advertisement
sergAccount

Untitled

Jul 17th, 2021
1,054
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Java 0.49 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.ex22;
  7.  
  8. // generic class Holder, T - тип
  9. public class Holder<T> {
  10.     // value переменная типа T
  11.     private T value;
  12.  
  13.     public T getValue() {
  14.         return value;
  15.     }
  16.     public void setValue(T value) {
  17.         this.value = value;
  18.     }
  19.    
  20.    
  21. }
  22.  
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement