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;



Comments and Discussions!

Load comments ↻





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