Oracle
1Z0-803 · Question #38
Which two will compile, and can be run successfully using the command: Java fred1 hello walls
The correct answer is C. Prints out: [Ljava.lang.String;@39341183 D. Prints out: walls. Throws java.lang.ArrayIndexOutOfBoundsException: 2 at certquestions.Fred1.main(Fred1.java:3)
Creating and Using Arrays
Question
Which two will compile, and can be run successfully using the command:
Java fred1 hello walls
Exhibit
Options
- AOption A
- BOption B
- CPrints out: [Ljava.lang.String;@39341183
- DPrints out: walls
How the community answered
(43 responses)- A14% (6)
- B5% (2)
- C81% (35)
Explanation
Throws java.lang.ArrayIndexOutOfBoundsException: 2 at certquestions.Fred1.main(Fred1.java:3)
Topics
#main method#command-line arguments#arrays#String[] args
Community Discussion
No community discussion yet for this question.
