Menu
Question Index
...

What will be the output of the following program?

class Play {
    private int card = 1200;
    public Play(int w) {
        card = w;
    }
    public void joker(int w) {
        card = w;
    }
    public String toString() {
        return Integer.toString(card);
    }
}
public class Playing {
    static void changePlay(Play p) {
    }
    public static void main(String[] args) {
        Play show = new Play(200);
        show.joker(1024);
        changePlay(show);
        System.out.println("Show is " + show + " points");
    }
}


Show is 200 points
Show is 1200 points
Show is 1024 points
Some other output
Compilation Error or Runtime Error

Doubts

Problems

Topic: Unknown

Read this topic
Take test on this topic

0
Wrong
Score more than 2 points

© meritcampus 2019

All Rights Reserved.

Open In App