Home » Java Aptitude Que. & Ans.

Java Operators Aptitude Questions and Answers (page 2)

Java Operators Aptitude Questions and Answers (page 2): This section provides you Java Operators related Aptitude Questions and Answers with multiple choices. Here, You will get solution and explanation of each question.

List of Java Operators Aptitude Questions and Answers

6) What will be the output of following program?
class Opr
{
    public static void main(String args[])
    {
        System.out.print( ((true && true) || false) );
    }
}

  1. Error
  2. false
  3. true
  4. None of these

7) What will be the output of following program?
class Opr
{
    public static void main(String args[])
    {
        int a,i;
        i=10;
        
        a=a+i;
        System.out.print(a);
        
    }
}
  1. 10
  2. Garbage
  3. Error
  4. None of these

8) What will be the output of following program?
public class Opr {
    public static void main(String[] args) {
      int a=0;
      System.out.print((a==true)? "Hello": "Hi");
    }
}
  1. Hello
  2. Hi
  3. Error
  4. Null

9) What will be the output of following program?
public class Opr {
    public static void main(String[] args) {
        System.out.print(0x000A + 0b1010 + 0xff);
    }
}
  1. Error
  2. 255
  3. 20ff
  4. 275

10) What will be the output of following program ?
class Opr 
{
    public static void main(String [] args) 
    {
        System.out.println( (10|5)+"-"+ (10|6));
    }
}
  1. 15-14
  2. 10-10
  3. 15-16
  4. 15-15

Page 1



Comments and Discussions!

Load comments ↻





Copyright © 2024 www.includehelp.com. All rights reserved.