In this lab, you will be learning about Operator Precedence and Associativity. Refer to the document attached for a detailed explanation of the code. The program is saved in a file named Operators.java.
Open the source code file named Operators.java using Netbeans or a text editor of your choice.
The following are done in the code:
- Declare 3 int variables assigning 20, 5, 17 to them
- Declare another 6 int variables which will contain the result of several arithmetic operations
- Display the results of the 6 operations (refer to Operators.java)
- Stop the execution of the Java code
3. Ensure Operators.java is compiled successfully
4. Execute the program. Record the output of this program and attach it to this assignment.
5. Explain how precedence and associativity affect the result.