This is very common Java programming style, to declare and initialize a variable at the same time. That is, we assign a value to label right in the type declaration statement. This emphasizes another important point. Java is very smart at using context to interpret your instructions. Looking at the class definition for Label , you can see that there are actually three different constructor methods with the same name, which are distinguished by their different arguments.
Inheritance uses the concept of polymorphsim, as well.
To see the difference between these two objects, we can make them different colors. This is a pretty boring applet. That is because we have not given it any special abilities to perform. Now the label is an attribute of the class that is shared by all methods in the class. This has already been done in HelloWorld1.html .