Skip to content

Commit 4b61897

Browse files
committed
[QUESTION] what is a generic constructor
1 parent 547916d commit 4b61897

1 file changed

Lines changed: 21 additions & 1 deletion

File tree

‎QUESTIONS.md‎

Lines changed: 21 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -604,4 +604,24 @@
604604
String pick2 = pick("a", new String());
605605
// intellij is still showing the type parameter as Serializable
606606
CharSequence pick3 = pick("a", new RandomList<Integer>());
607-
```
607+
```
608+
609+
38. generic constructors ?
610+
also type inference left me confused.
611+
what algo. does java use for type inference ?
612+
is scala magic preferable or is there a better explanation
613+
maybe read it again
614+
615+
https://docs.oracle.com/javase/tutorial/java/generics/genTypeInference.html
616+
617+
how to use ?
618+
619+
```java
620+
class MyClass<X> {
621+
<T> MyClass(T t) {
622+
// ...
623+
}
624+
}
625+
```
626+
627+
and what would be an actual example ?

0 commit comments

Comments
 (0)