Menu
Question Index
...

What will be the output of the following program?

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


%&@#~$@#
@%&@#~$#
%&-$@#@#
@#%&@#~$@#
Compilation Error or Runtime Error

Doubts

Problems

Topic: Static Keyword 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