exam questions

Exam 1z0-808 All Questions

View all questions & answers for the 1z0-808 exam

Exam 1z0-808 topic 1 question 114 discussion

Actual exam question from Oracle's 1z0-808
Question #: 114
Topic #: 1
[All 1z0-808 Questions]

Given:

And given the commands:

What is the result?

  • A. Java SE
  • B. Java EE
  • C. Compilation fails at line n1.
  • D. A NullPointerException is thrown at runtime.
Show Suggested Answer Hide Answer
Suggested Answer: A 🗳️

Comments

Chosen Answer:
This is a voting comment (?). It is better to Upvote an existing comment if you don't have anything to add.
Switch to a voting comment New
amit_lad88
3 days, 21 hours ago
Selected Answer: A
Java SE
upvoted 1 times
...
fvelazqueznava
2 months ago
Selected Answer: A
Java SE
upvoted 1 times
...
somrita90
3 months, 2 weeks ago
Answer A
upvoted 1 times
...
Sreeni_A
3 months, 4 weeks ago
Answer : A
upvoted 1 times
...
akbiyik
1 year ago
Selected Answer: A
public class Test { public static final int MIN = 1; public static void main(String[] args) { int x = args.length; if (checkLimit(x)) { System.out.println("Java SE"); } else { System.out.println("Java EE"); } } private static boolean checkLimit(int x) { return (x >= MIN) ? true : false; } } Tested in compiler and command line https://www.programiz.com/java-programming/online-compiler/ java -cp /tmp/EB79LfiRf0 Test Java EE java -cp /tmp/EB79LfiRf0 Test 1 Java SE
upvoted 2 times
...
carloswork
1 year, 1 month ago
Selected Answer: A
Answer is A. Args[ ] is receiving parameter from the command line. Therefore, its length will be greater than or equal to 1.
upvoted 1 times
...
iSnover
1 year, 2 months ago
Selected Answer: A
The right answer is the letter A, because in the command line passed the argument 1, that is, the String "1" is in the 0 place of the list with the indexing, but the list has size 1, so it is True printing " Java SE". If you take the raw code and play it in the IDE, it will print the letter B, but remembering that the args array is a list with no arguments and the argument "1" was passed to the console.
upvoted 3 times
...
Community vote distribution
A (35%)
C (25%)
B (20%)
Other
Most Voted
A voting comment increases the vote count for the chosen answer by one.

Upvoting a comment with a selected answer will also increase the vote count towards that answer by one. So if you see a comment that you already agree with, you can upvote it instead of posting a new comment.

SaveCancel
Loading ...
exam
Someone Bought Contributor Access for:
SY0-701
London, 1 minute ago