Title: Switch Examples (JPHF)
Course: CPS 161: An Intro to Programming with Java - DL MM MASTER > Section: Learning Units - Bb

Presentations and Videos

- Switch Examples (JPHF) lecture video (Time: 00:00)
- Switch Examples (JPHF) document

- SwitchDemo.java - comparison of the "if" statement approach to a switch statement approach with months of the year
- switch statement is normally used for integer like primitives: byte, int, short, long, char, or enumerated types(covered later)
- switch statements don't work with floats or doubles
- As of release 1.7, java now supports switch statements with the String class.