How does Java choose which constructor to use?

后端 未结 2 1465
甜味超标
甜味超标 2020-12-20 14:26

I am not able to understand the output of the following program.

public class Confusing {

    private Confusing(Object o) {
        System.out.println(\"Obj         


        
2条回答
  •  天命终不由人
    2020-12-20 15:20

    Even though both constructors can accept null, double[] inherits from java.lang.Object, and is therefore more specific.

提交回复
热议问题