What does “String[] args” contain in java?

后端 未结 8 1879
终归单人心
终归单人心 2020-12-15 08:18

When I run the following program:

public class Test
{
    public static void main(String[] args)
    {
        System.out.println(args);
    }
{
8条回答
  •  醉酒成梦
    2020-12-15 08:54

    Default implementation of toString method for Object is classname;@identityHashCode. I think, this is what you expect:

    System.out.println(java.util.Arrays.toString(args));
    

提交回复
热议问题