List<String> sampleList1 = new ArrayList<String>();
System.out.println(sampleList1);
System.out.println(sampleList1.size());
List<String> sampleList2;
//System.out.println(sampleList2);← Compile error that the local variable sampleList2 may not have been initialized.
List<String> sampleList3 = new ArrayList<String>();
sampleList3.add("");
System.out.println(sampleList3);
System.out.println(sampleList3.size());
Recommended Posts