What happens when the following code is compiled?

public class Performer {
    public static void main(String[] args) {
        if (args instanceof Object) { // 1 
            System.out.println("yes");
        } else {
            System.out.println("no");
        }
    }
}
Explanation
yes will be printed out since array is also Object

Follow CodeGalaxy

Mobile Beta

Get it on Google Play
Send Feedback