This week's book giveaway is in the Big Data forum.
We're giving away four copies of Elasticsearch in Action and have Radu Gheorghe & Matthew Lee Hinman on-line!
See this thread for details.
The moose likes Programmer Certification (SCJP/OCPJP) and the fly likes Enthuware question Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login

Win a copy of Elasticsearch in Action this week in the Big Data forum!
JavaRanch » Java Forums » Certification » Programmer Certification (SCJP/OCPJP)
Bookmark "Enthuware question" Watch "Enthuware question" New topic

Enthuware question

Daniel Martins
Ranch Hand

Joined: Oct 22, 2009
Posts: 45

According to the answer provided, answer 2 is correct but I don't think so...
Ankit Garg

Joined: Aug 03, 2008
Posts: 9327

Both 1 and 2 looks like the correct answers to me, why do you think 2 is not the right answer??

SCJP 6 | SCWCD 5 | Javaranch SCJP FAQ | SCWCD Links
Daniel Martins
Ranch Hand

Joined: Oct 22, 2009
Posts: 45
exit without any output and exceptions if no arguments are given?

But no arguments means args.length=0 and will lead to arg[-1] bellow.


What did I miss?

Jack Bento
Ranch Hand

Joined: Jun 14, 2009
Posts: 34
Daniel Martins wrote: args.length=0 and will lead to arg[-1]

and that will throw the exception and output nothing
With a little knowledge, a cast iron skillet is non-stick and lasts a lifetime.
subject: Enthuware question