ADVERTISEMENT
ADVERTISEMENT

Home » Java Aptitude Que. & Ans.

Java Basic Input & Output Aptitude Questions and Answers. Page 3

List of Java Basic I/O Aptitude Questions

11) What will be the output of following program?
public class prg {
    public static void main(String[] args) {
        System.out.println( (byte) 0xff);
    }
}
  1. -1
  2. 255
  3. 65535
  4. 0xff

12 What will be the output of following program?
public class prg {
    public static void main(String[] args) {
        System.out.println( (int)(char)(byte) 0xff);
    }
}
  1. -1
  2. 255
  3. 65535
  4. 0xff

13 Which is the correct declaration of a boolean variable?
  1. boolean isAdult='false';
  2. boolean isAdult=0;
  3. boolean isAdult="false";
  4. boolean isAdult=false;

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.