Java Test 2 Section 2

16 Questions | Attempts: 53
Share

SettingsSettingsSettings
Java Quizzes & Trivia

This section consists of questions on arithmetic operations.


Questions and Answers
  • 1. 

    What will be the value of i after the following integer operation is executed? int i = 4 - 2 * 3;

  • 2. 

    What will be the value of i after the following integer operation is executed? int i = -34/6;

  • 3. 

    What will be the value of i after the following integer operation is executed? int i = 37%6;

  • 4. 

    What will be the value of i after the following integer operation is executed? int i = 24 * 21 % 7 + -36 / -9;

  • 5. 

    What will be the value of i after the following integer operation is executed? int i = ( 29 / 2 ) % 4;

  • 6. 

    What will be the value of i after the following integer operation is executed? int i = 5 * 4 + 21 % 3;

  • 7. 

    What will be the value of i after the following integer operation is executed? int i = -5 * 2 + 7-4 *3;

  • 8. 

    Evaluate the following expression.5.6-2.1+1.3

  • 9. 

    Evaluate the following expression.0.5+3.75/0.25*2

  • 10. 

    Evaluate the following expression.12.5-(1.2+(4.0-2.0)*3.0)+1.5

  • 11. 

    Evaluate the following expression.-3.0*((1.3+2.5)*4.0)+2.0

  • 12. 

    Determine what will be displayed by the writeInfo() method. Assume io has been defined as an object of the StaugIO class.int i = 0;int j = 13;io.writeInfo(--i + j--);

  • 13. 

    Determine what will be displayed by the writeInfo() method. Assume io has been defined as an object of the StaugIO class.int k = 6;io.writeInfo(++k * 2);

  • 14. 

    Determine what will be displayed by the writeInfo() method. Assume io has been defined as an object of the StaugIO class.int i =0;int j = 15;io.writeInfo(++i + j--);

  • 15. 

    Determine what will be displayed by the writeInfo() method. Assume io has been defined as an object of the StaugIO class.int x = 2;int y = -2;int z = 20;io.writeInfo(x++ - --y  + ++z);

  • 16. 

    Evaluate the following expression:(4%7)*(5.2/2.0)

Quiz Review Timeline +

Our quizzes are rigorously reviewed, monitored and continuously updated by our expert board to maintain accuracy, relevance, and timeliness.

  • Current Version
  • Mar 20, 2022
    Quiz Edited by
    ProProfs Editorial Team
  • Oct 28, 2009
    Quiz Created by
    Yupeilin
Back to Top Back to top
Advertisement
×

Wait!
Here's an interesting quiz for you.

We have other quizzes matching your interest.