Notice the comments after each import statement. They document which packages supply which classes and interfaces to the compiler.
The default layout for JFrame's content pane is BorderLayout. When the panel of checkboxes is added to the content pane it is left-justified. The line
frame.getContentPane().setLayout( new FlowLayout() );causes the checkboxes to be centered in the content pane.
Notice that a single "object reference" variable is being used to create each of the JCheckBox components. When the checkbox is added to the panel, the panel object makes its own copy of the checkbox object reference. Once a second reference to the checkbox object is established, the first reference may then be used to create a new object. The garbage collector will cause an object to go away only when no references remain to the object.
[Reference: Topley, pp583-590]