Practice Parsing Problems

For each of the following, if the Java statement is legal, parse it using the rules from the text. Otherwise, explain why the statement is not legal.

The rules for Java are available online.

  1. exp = life / 7 + 12; Be sure to show every step and give the number of each rule that you are using.

  2. b1 = new Button("Hello"); Be sure to show every step and give the number of each rule that you are using.

  3. age = "jeff" - 72; Be sure to show every step and give the number of each rule that you are using.