Menu
Question Index
...

What will be the output of the following program?

class Draft {
    private static String[] String;
    static {
        Draft.main(String);
        System.out.print("%");
    }
    public static void main(String[] args) {
        Draft.main(new String());
        System.out.print("#");
    }
    static void main(String args) {
        System.out.print("@");
    }
    static {
        System.out.print("&");
    }
    static {
        Draft.main(String);
        System.out.print("~");
    }
    static {
        System.out.print("$");
    }
}


%&@#~$@#
@%&@#~$#
%&-$@#@#
@#%&@#~$@#
Some other output
Compilation Error or Runtime Error

Doubts

Problems

Topic: Creating Static Methods In Java Using Static Keyword

Read this topic
Take test on this topic

0
Wrong
Score more than 2 points

© meritcampus 2019

All Rights Reserved.

Open In App