exam questions

Exam 1z0-808 All Questions

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

Exam 1z0-808 topic 1 question 56 discussion

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

Given:

What is the result?

  • A. int main 1
  • B. Object main 1
  • C. String main 1
  • D. Compilation fails
  • E. An exception is thrown at runtime
Show Suggested Answer Hide Answer
Suggested Answer: C 🗳️

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
letmein2
Highly Voted 4 years, 5 months ago
correct. You can overload the main() method, but only public static void main(String[] args) will be used when your class is launched by the JVM.
upvoted 23 times
...
fvelazqueznava
Most Recent 3 months, 1 week ago
Selected Answer: C
yOU CAN OVERRIDE MAIN METHOD,BUT ALWAYS THE JVM WILL EXECUTE THE STRING [] ARGS
upvoted 1 times
...
Vicky_65
9 months, 2 weeks ago
Selected Answer: C
C is the right one
upvoted 1 times
...
carloswork
1 year, 2 months ago
To test: public class Test { public static void main(int[] args) { System.out.println("int main " + args[0]); }//main int public static void main(Object[] args) { System.out.println("Object main " + args[0]); }//main Object public static void main(String[] args) { System.out.println("String main " + args[0]); }//main String }
upvoted 1 times
carloswork
1 year, 2 months ago
Note: Run on command line or on IDE with args...
upvoted 1 times
...
...
carloswork
1 year, 3 months ago
Selected Answer: C
Answer is C. Note that the main method is being overloaded and is called from the command line. In this way, it is possible to perform this overload. This can be tested by following what I'm saying.
upvoted 1 times
...
kkaayyyy
1 year, 3 months ago
C - String main 1 is the answer because even after reloading main function it will still accept the main with String[] args
upvoted 1 times
...
iSnover
1 year, 3 months ago
Selected Answer: C
Only public static void main(String[] args) will be used when your class is launched by the JVM.
upvoted 1 times
...
Joker74
1 year, 4 months ago
Selected Answer: C
Answer C
upvoted 2 times
...
babacandy
3 years, 3 months ago
Answer is C.
upvoted 4 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