exam questions

Exam 1z0-808 All Questions

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

Exam 1z0-808 topic 1 question 97 discussion

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

You are asked to create a method that accepts an array of integers and returns the highest value from that array.
Given the code fragment:

Which method signature do you use at line n1?

  • A. public int findMax (int[] numbers)
  • B. static int[] findMax (int[] max)
  • C. static int findMax (int[] numbers)
  • D. final int findMax (int[] )
Show Suggested Answer Hide Answer
Suggested Answer: B 🗳️

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
praroopgupta
Highly Voted 2 years, 3 months ago
Answer should be B as we want int array as response.
upvoted 5 times
...
MPignaProTech
Most Recent 3 months ago
Selected Answer: B
correct answer is B
upvoted 1 times
...
7df49fb
10 months ago
Don't be confused !! method : access modifier optional specifier return type methode name (parameters) static int findMax(int[]) static : because, the method is used directly in a static main method (the method exist alone without instanciating the class Test) int : return type, we want just the maximum int value from the array int[]: the method takes an array of int.
upvoted 1 times
...
DarGrin
1 year, 3 months ago
Selected Answer: B
Answer is B
upvoted 1 times
...
dsms
1 year, 5 months ago
Selected Answer: C
The answer is C: static int findMax (int[] numbers)
upvoted 2 times
...
IbrahimAlnutayfi
1 year, 6 months ago
Selected Answer: B
The answer is B
upvoted 1 times
...
Kolodets
1 year, 8 months ago
Judging by question, we need single value so I would take C. But in the code array is returned (strangely), so B
upvoted 1 times
...
CreazyyyyGirl
1 year, 10 months ago
Selected Answer: B
Correct answer is : B
upvoted 1 times
...
Annie432
1 year, 11 months ago
Selected Answer: B
Return type is int[]
upvoted 1 times
...
baledevit
2 years, 3 months ago
Selected Answer: B
Correct answer is B!
upvoted 3 times
...
iSnover
2 years, 3 months ago
Correct is Letter B because we want int array as response and I tested.
upvoted 2 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