Menu
Question Index
...

What will be the output of following program?

public class ClassInitialization {

    boolean b;
    byte by;
    char A = 65;

    public static void main(String[] args) {
        ClassInitialization demo = new ClassInitialization();
        System.out.println("b = " + demo.b);
        System.out.println("by = " + demo.by);
        System.out.println("c = " + demo.A);
    }
}


b = true
by = 0
c = 65

b = false
by = 0
c = A

Some other output
Compilation Error or Runtime Error

Doubts

Problems

Topic: Member Variable 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