Normal
Aktuell benutzt du das type Feld ja gar nicht. Deswegen:[code=java]public class Generic<T> { public static void main(String[] args) { String str = "hello"; Generic<String> g = new Generic<>(); g.doStuff(str); } private void doStuff(T arg) { System.out.println(arg); }}[/code]
Aktuell benutzt du das type Feld ja gar nicht. Deswegen:
[code=java]
public class Generic<T> {
public static void main(String[] args) {
String str = "hello";
Generic<String> g = new Generic<>();
g.doStuff(str);
}
private void doStuff(T arg) {
System.out.println(arg);
[/code]