public class Output <T>{
    T outputText;

    public Output(T outputText) {
        this.outputText = outputText;
    }

    public void out() {
        System.out.println(outputText);
    }

}
public class Print {
    public static void main(String[] args) {
        Output<Integer> intEx = new Output<>(1);
        intEx.out(); 

        Output<String> intEx2 = new Output<>("test");
        intEx2.out();
    }
}
Print.main(null)
1
test