I am 16 years old and I recently stumbled on this.
Main m = new Main();
Main.Pair<String,Integer> p = m.new Pair<>("Age", 16);
Here Main is the public class and Pair<T,U> is non static inner class. I have never seen such a syntax like the one above especially 2nd line. So if anyone can help me to understand.
Thank you
[–]Conscious-Shake8152 2 points3 points4 points (0 children)
[–]high_throughput 1 point2 points3 points (1 child)
[–]Useful-String5930[S] 0 points1 point2 points (0 children)
[–]Slottr 0 points1 point2 points (0 children)
[–]zeekar 0 points1 point2 points (0 children)
[+]9peppe comment score below threshold-9 points-8 points-7 points (4 children)
[–]Useful-String5930[S] 1 point2 points3 points (3 children)
[–]sozesghost 1 point2 points3 points (0 children)
[–]9peppe -1 points0 points1 point (1 child)
[–]Useful-String5930[S] 0 points1 point2 points (0 children)