ITEC30 (Sir Jonel) Flashcards
Allows Java Application to display information in the command prompt / MS-DOS Prompt
Standard Output Object
Standard Output Object
2 TYPES
System.out.print()
System.out.println()
does not position the cursor to beginning of the next line after printing
System.out.print()
position the cursor to the beginning of the next line after printing
System.out.println()
Class that allows to easily display dialog box containing information
JOptionPane.showMessageDialog()
to refer to the standard output device
System.out
to refer to the standard input device.
System.in
is not directly supported in Java
Console input
to create an object to read input from System.in
Scanner class
creates an object of the Scanner type.
Scanner(System.in)
declares that input is a variable whose type is Scanner.
Scanner sc
creates a Scanner object and assigns its reference to the variable input.
Scanner sc = new Scanner(System.in)
This class is used to display simple dialog boxes to get the text input from the user.
method always returns the user’s input as a String.
JOptionPane.showInputDialog()
is a static method of JOptionPane class. This method uses single parameter that specifies the prompting message that is displayed in the dialog box.
showInputDialog
refers to a style of programming
Programming Paradigm