What kind of variable is label?

            public class Labeller extends JFrame {
              public Labeller () {
                JLabel label = new JLabel("Field or Variable");
              }
             
              public static void main (String[] args) {
               new Labeller();
              }
            }
        

local variable, Object Reference
  • Instance variable, Object Reference
  • local variable, primitive
  • Instance variable, primitive

Variables that are instantiated within a method are local to the function. Primitives are raw values such as ints, booleans and chars.