Menu
Question Index
...

What is the output of the following program?

public class Krish {
    static char c = 70;
    public static void main(String[] args) {
        Krish krish = new Krish();
        System.out.print(c + " ");
        krish(c);
        System.out.println(c);
    }
    static void krish(char c) {
        int cr = c;
        cr = cr * 2;
        cr = cr + c - 20;
        c = (char) cr;
    }
}


F 50
f 50
F f
F F
f f
70 F

Doubts

Problems

Topic: Static and Non Static Variables - Static and Non Static Methods

Read this topic
Take test on this topic

0
Wrong
Score more than 2 points

© meritcampus 2019

All Rights Reserved.

Open In App