February 2014
Beginner
1248 pages
62h 25m
English
JOptionPane method showMessageDialog is a so-called static method. Such methods often define frequently used tasks. For example, many programs display dialog boxes, and the code to do this is the same each time. Rather than requiring you to “reinvent the wheel” and create code to display a dialog, the designers of class JOptionPane declared a static method that performs this task for you. A static method is called by using its class name followed by a dot (.) and the method name, as in
ClassName.methodName(arguments)
Notice that you do not create an object of class JOptionPane to use its static method showMessageDialog.We discuss static methods in more detail in Chapter 6.
Read now
Unlock full access