<> が右側にしか存在しないのに、Java がコード行の下を受け入れるのはなぜですか? <> 記号には、このような (ジェネリック機能) の目的はありませんか?
List balloons = new ArrayList<>();
これまでのところ、以下の例に示すように、右側の <> の使用しか理解していません。ここで Java は左側の型を推測するので、右側を再度指定する必要はなく、単純に <> を使用できます。
List<String> balloons = new ArrayList<>();
balloons.add("blue");
balloons.add("yellow");
// balloons.add(1); // will not compile as balloons is type safe, demanding String input
System.out.println(balloons.get(0));
System.out.println(balloons.get(1));
// System.out.println(balloons.get(2));