Game Preview

Introduction to Java Programming - Activity#3

  •  English    17     Public
    Write and evaluate arithmetic expressions that include variables and operators and compute its value based on the way variables and operators are sequenced in a code segment.
  •   Study   Slideshow
  • What is the output of the above code segment?
    6
  •  10
  • What is the output for the above code segment?
    10
  •  10
  • What is the final output of the code segment?
    0
  •  10
  • What is the final result of the following expression as evaluated by Java? (2*20-6/3)%4
    2
  •  10
  • True or False: In the expression x %= 10, x is divided by 10 and the integer result is stored in x.
    False
  •  10
  • True or False: String is not a primitive type.
    True
  •  10
  • True or False: float primitive type can hold larger value than double primitive type.
    False
  •  10
  • What is the value of result after executing the following statements?
    119
  •  10
  • Which of the following is not an arithmetic operator?
    =
  •  10
  • Which of the following is the appropriate data type for the above example?
    boolean
  •  10
  • What is the output of the following Java program?
    MySuperJava
  •  10
  • Which of the following is the correct way to declare variables?
    int num1, num2;
  •  10
  • Which of the following is used as a compound assignment operator?
    +=
  •  10
  • What is the alternative expression of m += n?
    m = m + n
  •  10
  • What is the output of the following code segment?
    2
  •  10
  • What is the output of the following code segment?
    21
  •  10