Code1 will have compiling error because WaterBottle1‘s attributes brand and empty are private;
Code2 will output “Empty = false Brand = null”.
Code3 varargs(可变长参数) are allowed in place of an array
Conclusion
The main method is an entry of a program, but it is still a class method, so it has right to access all attributes of that class. By the way, Boolean fields initialize to false and references initialize to null, so empty is false and brand is null. Brand = null is output.