12). Which of these coding types is used for data type characters in Java?

[A]ASCII
[B]ISO-LATIN-1
[C]UNICODE
[D]None of the mentioned

Show Answer

14). Which of these occupy first 0 to 127 in Unicode character set used for characters in Java?

[A]ASCII
[B] ISO-LATIN-1
[C]None of the mentioned
[D]ASCII and ISO-LATIN1

Show Answer

15). Which one is a valid declaration of a boolean?

[A] boolean b1 = 1;
[B]boolean b2 = ‘false’;
[C]boolean b3 = false;
[D]boolean b4 = ‘true’

Show Answer

16). What will be the output of the following Java program?
    class array_output {
        public static void main(String args[]) 
        {    
            char array_variable [] = new char[10];
	    for (int i = 0; i < 10; ++i) {
                array_variable[i] = 'i';
                System.out.print(array_variable[i] + "" );
                i++;
            }
        } 
    }

[A]i i i i i
[B]0 1 2 3 4
[C]i j k l m
[D]None of the mentioned

Show Answer

17). What will be the output of the following Java program?
    class mainclass {
        public static void main(String args[]) 
        {
            char a = 'A';
            a++;
	    System.out.print((int)a);
        } 
    }

[A]66
[B]67
[C]65
[D]64

Show Answer

18). What will be the output of the following Java program?
    class mainclass {
        public static void main(String args[]) 
        {
            boolean var1 = true;
	    boolean var2 = false;
	    if (var1)
	        System.out.println(var1);
	    else
	        System.out.println(var2);
       } 
    }

[A]0
[B]1
[C]true
[D]false

Show Answer

19). What will be the output of the following Java code?
    class booloperators {
        public static void main(String args[]) 
        {
            boolean var1 = true;
	    boolean var2 = false;
	    System.out.println((var1 & var2));
        } 
    }

[A]0
[B]1
[C]true
[D]false

Show Answer

20). What will be the output of the following Java code?
    class asciicodes {
        public static void main(String args[]) 
        {
            char var1 = 'A';
	    char var2 = 'a';
	    System.out.println((int)var1 + " " + (int)var2);
        } 
    }

[A]162
[B] 65 97
[C]67 95
[D]66 98

Show Answer