Menu
Topics Index
...
`

System


If you need explanation Read this topic

If you need Answer Take test on this topic

System
What will be the output of the following program?
public class System {
    public static void main(String args[]) {
        char keyboard = 'K';
        char chair = 'C';
        Character table = new Character(keyboard);
        Character table1 = new Character(chair);
        System.out.println(table + table1);
        System.out.print(table + " " + table1);
    }
}

A. KC
K C
B. 142
KC
C. 142
K C
D. Compilation Error
E. Runtime Error
Topic: Java Character Class

If you need explanation Read this topic

If you need Answer Take test on this topic

User comments below. All of them might not be correct.

ans : d
in
system. out print ()  we can't pass char only can string....so  in 7 th line error occur

Posted by Ananda Kumar    2014-04-01 03:54:47


ans c character objects table and table1 are created with character constructor which adds ascii values and in the nxt print statement it prints characters with space as defined

Posted by Navya Golla    2014-04-01 07:01:57


Congratulations Navya Golla. You are this dose winner. We will send you the link using which you can claim your recharge.

Posted by Merit Campus    2014-04-02 04:44:27


© meritcampus 2019

All Rights Reserved.

Open In App