User Tools

Site Tools


project:week01

Course Overview; Data Types and Control Flow

Lecture 1

Course Overview

Problem: How is basic arithmetic and string manipulation done?

  • Primitive types
    • byte
    • short
    • int
    • long
    • float
    • double
    • char
    • boolean
  • Object types
    • references
    • String
    • members and methods
    • new needed
  • Expressions
    • Assignment
    • Arithmetic
    • Precedence
    • Sequencing
    • Casting
    • Constants

Examples

Lecture 2

Problem: How can choices be made and actions done repeatedly?

  • Selection
    • Simple if statements
    • Nested if statements
    • switch statements
    • == vs. equals()
  • Boolean logic
    • And, or, not operators
    • Short-circuit evaluation
  • Repetition
    • while loops
    • for loops
    • do-while loops
    • Pitfalls
      • Infinite loops
      • Off by one errors
      • Overflow
      • Never entering the loop

Examples

Lab

Introduction to DrJava

project/week01.txt · Last modified: 2010/05/11 14:53 by jtk