Commit b4ec8362 authored by Trisha Gee's avatar Trisha Gee
Browse files

[Ch1] Be the compiler

parent 37a5e049
Loading
Loading
Loading
Loading
+12 −0
Changes for src/main/java/ch1/Exercise1a.java: 12 added lines, 0 removed lines.
Original line number Diff line number Diff line
package ch1;

class Exercise1a {
  public static void main(String[] args) {
    int x = 1;
    while (x < 10) {
      if (x > 3) {
        System.out.println("big x");
      }
    }
  }
}
 No newline at end of file
+14 −0
Changes for src/main/java/ch1/Exercise1b.java: 14 added lines, 0 removed lines.
Original line number Diff line number Diff line
package ch1;

// class declaration intentionally missing in exercise
public class Exercise1b {
  public static void main(String [] args) {
    int x = 5;
    while ( x > 1 ) {
      x = x - 1;
      if ( x < 3) {
        System.out.println("small x");
      }
    }
  }
}
+14 −0
Changes for src/main/java/ch1/Exercise1c.java: 14 added lines, 0 removed lines.
Original line number Diff line number Diff line
package ch1;

class Exercise1c {
  // method declaration intentionally missing in exercise
  public static void main(String[] args) {
    int x = 5;
    while (x > 1) {
      x = x - 1;
      if (x < 3) {
        System.out.println("small x");
      }
    }
  }
}
 No newline at end of file