リストやマップは入れ子構造にすることが可能です。
例えばマップを入れ子構造にするには次のようにします。
import java.util.HashMap;
public class Main{
public static void main(String[] args) {
var sincho = new HashMap<String, HashMap<String, Integer>>();
sincho.put("1組", new HashMap<String, Integer>() );
sincho.get("1組").put( "安倍", 162 );
sincho.get("1組").put( "田中", 132 );
sincho.put("2組", new HashMap<String, Integer>() );
sincho.get("2組").put( "鈴木", 151 );
sincho.get("2組").put( "本田", 172 );
System.out.println(sincho);
}
}
実行結果は以下の通りです。
{2組={鈴木=151, 本田=172}, 1組={田中=132, 安倍=162}}