Which line will a compilation error occur in?

public class Test {
    public static void main(String\u005B\u005D args) { // 2
        char a = '\u005B'; // 3
        char c = '\u005D'; // 4
        System.out.println(a * c); // 5
    }
}
Explanation
Sequences beginning with \u can be specified even outside the char constants and strings and are interpreted as UTF-16 encoded characters. Given example is correct since sequences \u005B and \u005D match the characters [ and ] respectively.
Java
Java Quiz
Start Quiz

or Read more about Java Quiz

Follow CodeGalaxy

Mobile Beta

Get it on Google Play
Send Feedback