So, if you want to perform some initialization, you will have to write some constructors for your class. Load all the images. This particular Thread constructor takes a String that sets the name of Thread . Often a constructor wants to take advantage of initialization code written in a class's superclass. Indeed, some classes must call their superclass constructor in order for the object to work properly.
Constructors provide a way to initialize a new object.
Initializing Instance and Class Members describes other ways you can provide for the initialization of your class and a new object created from the class. That section also discusses when and why you would use each technique.