Menu
Question Index
...

What will be the output of the following program?

public class LiteralsTest {
    public static void main(String[] args) {
        String name = "Ram";
        char section = 'A';
        int rollNum = section;
        boolean status = true;
        System.out.println("Name: " + name);
        System.out.println("Roll number: " + rollNum);
        System.out.println("Result: " + status);
    }
}


Name: Ram
Roll number: 64
Result: true
Name: Ram
Roll number: 65
Result: true
Name: Ram
Roll number: 20
Result: True
Compilation Error
Runtime Error

Doubts

Problems

Topic: Type Conversion In Java

Read this topic
Take test on this topic

0
Wrong
Score more than 2 points

© meritcampus 2019

All Rights Reserved.

Open In App