What Exacly (args.length>0) means?

前端 未结 6 1345
既然无缘
既然无缘 2021-01-27 23:06

This may be simple to you people but as i am new to java, so i want know actually what is going on in the following part?

if (args.length > 0) {
    file =          


        
6条回答
  •  温柔的废话
    2021-01-27 23:51

    You are making String reference here and put the value in it. You first value is> test1.xml. It is a name of a file but you are putting into String as String(It means "test1.xml"). and then taking value from command line argument. And overriding value of you string reference by command line location 0. so you reference value will be always command line 0 location value if you do not pass any value then it will give you text1.xml

提交回复
热议问题