This is a very general question and i’d like to apologize in advance for the noob question BUT….
in java, well in general, is there a specific name for in line declarations, or is it simply called just that?
i’m referring to the method below for declaring objects:
panel.add(new JLabel("Hello World"));
as opposed to:
JLabel label = new JLabel("Hello World);
panel.add(label);
People seem to call it “anonymous object” or “unnamed object”. See also https://stackoverflow.com/a/5330408/659002