Menu
Question Index
...

What will be the output of the following program? Assume that if we run XXL class.

package com.mc.size;
import com.mc.group.M;
import com.mc.type.XL;
public class XXL {
    public static void main(String[] args) {
        System.out.print(XL.str + XL.srt + XL.rts + XL.rst);
        System.out.print(M.a);
    }
}
package com.mc.type;
public class XL {
    public String str = "~", srt = "&", rts = "#", rst = "@";
}
package com.mc.group;
public class M {
    public char[] a = {'a', 'b', 'c'};
}


~&#@a~&#@b~&#@c
~&#@abca~&#@abcb~&#@abcc
~&#@abc
Compilation Error
Runtime Error

Doubts

Problems

Topic: Java Package

Read this topic
Take test on this topic

0
Wrong
Score more than 2 points

© meritcampus 2019

All Rights Reserved.

Open In App