Commit 632afcbd authored by Trisha Gee's avatar Trisha Gee
Browse files

[Ch4] MixedMessages

parent 61c176c6
Loading
Loading
Loading
Loading
+29 −0
Changes for src/main/java/ch4/Mix4.java: 29 added lines, 0 removed lines.
Original line number Diff line number Diff line
package ch4;

public class Mix4 {
  int counter = 0;

  public static void main(String[] args) {
    int count = 0;
    Mix4[] m4a = new Mix4[20];
    int x = 0;
//    while () {
      m4a[x] = new Mix4();
      m4a[x].counter = m4a[x].counter + 1;
      count = count + 1;
      count = count + m4a[x].maybeNew(x);
      x = x + 1;
//    }
    System.out.println(count + " "
                       + m4a[1].counter);
  }

  public int maybeNew(int index) {
//    if (             ) {
      Mix4 m4 = new Mix4();
      m4.counter = m4.counter + 1;
      return 1;
//    }
//    return 0;
  }
}
 No newline at end of file