ADVERTISEMENT
ADVERTISEMENT

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

ADVERTISEMENT



ADVERTISEMENT



Comments and Discussions


ADVERTISEMENT

ADVERTISEMENT
ADVERTISEMENT
ADVERTISEMENT

Languages: » C » C++ » C++ STL » Java » Data Structure » C#.Net » Android » Kotlin » SQL
Web Technologies: » PHP » Python » JavaScript » CSS » Ajax » Node.js » Web programming/HTML
Solved programs: » C » C++ » DS » Java » C#
Aptitude que. & ans.: » C » C++ » Java » DBMS
Interview que. & ans.: » C » Embedded C » Java » SEO » HR
CS Subjects: » CS Basics » O.S. » Networks » DBMS » Embedded Systems » Cloud Computing
» Machine learning » CS Organizations » Linux » DOS
More: » Articles » Puzzles » News/Updates

© https://www.includehelp.com some rights reserved.