Menu
Question Index
...

What will be the output of the following program?

public class Literals {
    public static void main(String[] args) {
        String name = "Ram";
        char section = 'A';
        boolean status = true;
        float percentage = 75.3f;
        System.out.println("Name: " + name);
        System.out.println("Result: " + status);
        System.out.println("Percentage: " + percentage);
    }
}


Name: Ram
Result: true
Percentage: 75.3f
Name: Ram
Result: true
Percentage: 75.3
Name: Ram
Result: true
Percentage: 75
Compilation Error
Runtime Error

Doubts

Problems

Topic: Boolean Literals 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