Java: CMIS 102A - Program Prototypes

These typical programs should be mastered by introductory Java students. They use both console and dialog I/O.

Sequential control flow

Topics

ProgramIODataFlowJava constructions and programming concepts
DoNothing.java None - - Class definition, main definition.
HelloEarthlingC.java Console String Seq. System.out.println(...)
HelloEarthlingD.java Dialog String Seq. String literal.
JOptionPane.showMessageDialog(null, ...)
ToYourLeader.java Console String Seq. Concepts: Variable, assignment, input, declaration.
import java.util.*;
Scanner in = new Scanner(System.in);
in.next()
JOptionPane.showMessageDialog(null, ...)

Conditional control flow using if statements

Topics

Programs

Loops

Topics

Programs


Copyleft 2006 Fred Swartz