Study

Introduction to Java Programming - Activity#3

  •   0%
  •  0     0     0

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