82). Which of the following can be operands of arithmetic operators?

[A]Numeric
[B]Boolean
[C]Characters
[D]Both Numeric & Characters

Show Answer

83). Modulus operator, %, can be applied to which of these?

[A]Integers
[B]Floating – point numbers
[C]Both Integers and floating – point numbers
[D]None of the mentioned

Show Answer

84). With x = 0, which of the following are legal lines of Java code for changing the value of x to 1?
  1. x++;
   2. x = x + 1;
   3. x += 1;
   4. x =+ 1;

[A]1, 2 & 3
[B] 1 & 4
[C] 1, 2, 3 & 4
[D] 3 & 2

Show Answer

86). Which of these statements are incorrect?
  1. x++;
   2. x = x + 1;
   3. x += 1;
   4. x =+ 1;

[A]Assignment operators are more efficiently implemented by Java run-time system than their equivalent long forms
[B] Assignment operators run faster than their equivalent long forms
[C]Assignment operators can be used only with numeric and character data type
[D] None of the mentioned

Show Answer

87). What will be the output of the following Java program?
    class increment 
    {
        public static void main(String args[])
        {
            double var1 = 1 + 5; 
            double var2 = var1 / 4;
            int var3 = 1 + 5;
            int var4 = var3 / 4;
            System.out.print(var2 + " " + var4);
 
        } 
    }

[A]1 1
[B]0 1
[C]1.5 1
[D]1.5 1.0

Show Answer

88). What will be the output of the following Java program?
    class Modulus 
    {
        public static void main(String args[]) 
        {    
             double a = 25.64;
             int  b = 25;
             a = a % 10;
             b = b % 10;
             System.out.println(a + " "  + b);
        } 
    }

[A]5.640000000000001 5
[B]5.640000000000001 5.0
[C] 5 5
[D]5 5.640000000000001

Show Answer

89). What will be the output of the following Java program?
    class increment 
    {
        public static void main(String args[]) 
        {        
             int g = 3;
             System.out.print(++g * 8);
        } 
    }

[A]25
[B]24
[C]32
[D]33

Show Answer

90). Can 8 byte long data type be automatically type cast to 4 byte float data type?
    class increment 
    {
        public static void main(String args[]) 
        {        
             int g = 3;
             System.out.print(++g * 8);
        } 
    }

[A]True
[B]False
[C]none
[D]none

Show Answer

91). What will be the output of the following Java program?
    class Output 
    {
        public static void main(String args[]) 
        {    
             int a = 1;
             int b = 2;
             int c;
             int d;
             c = ++b;
             d = a++;
             c++;
             b++;
             ++a;
             System.out.println(a + " " + b + " " + c);
        } 
    }

[A]3 2 4
[B] 3 2 3
[C]2 3 4
[D]3 4 4

Show Answer