Pos406 Week 3
Essay by 24 • November 29, 2010 • 398 Words (2 Pages) • 1,439 Views
Week 3 Discussion Questions
Describe the various members that a class definition can contain.
The class definition of a java program defines the classes and methods that will be used in the program. It also contains an access modifier such as public, which allows access to classes, methods, and data types by other classes. Other access modifiers are private and protected. Along with the access modifier, a class definition also contains the programmer-defined class name, or name of the program. A class definition can also include variable declarations , which consist of a variable name and the data type of that variable. Methods, such as main(), and constructors can also be defined in the class definition. Constructors create new instances of an object in the program.
Based on the Zhang and Nguyen (2004) article, describe and explain the benefits of using the DataInputStream class for inputs, and compare DataInputStream to the JOptionPane.showInputDialog class for providing input capabilities to your Java program. What is the key disadvantage of use the JOptionPane.showInputDialog?
The difference between the two classes is that DataInputStream pauses the programs and waits for the user’s input, whereas JOptionPane.showDialog provides a graphical dialog box with a field where the user can input the data. When using DataInputStream, this data is then sent to the InputStreamReader, where it is buffered and stored until it is read by the BufferedReader. The main disadvantage of using JOptionPane.showDialog is that the data entered by the user is read as a String, and must be converted to the correct data type before it can be used as intended.
Based on Coffee’s (2004) article, list and describe some of the technologies that developers are integrating Java applications into. Do you feel that Java is appropriate for some of these technologies,
...
...