Top Posters
Since Sunday
s
5
g
5
K
5
o
5
g
5
o
4
k
4
s
4
I
4
k
4
j
4
o
4
New Topic  
Tneary Tneary
wrote...
Posts: 463
Rep: 9 0
4 years ago
What is the output of the following code?

double[] myList = {1, 5, 5, 5, 5, 1};
double max = myList[0];
int indexOfMax = 0;
for (int i = 1; i < myList.length; i++) {
if (myList[i] >= max) {
max = myList[i];
indexOfMax = i;
}
}
System.out.println(indexOfMax);


▸ 0

▸ 1

▸ 2

▸ 3

▸ 4
Textbook 
Introduction to Java Programming, Comprehensive Version

Introduction to Java Programming, Comprehensive Version


Edition: 10th
Author:
Read 61 times
1 Reply
Replies
Answer verified by a subject expert
Lori734Lori734
wrote...
Posts: 394
4 years ago
Sign in or Sign up in seconds to unlock everything for free
More solutions for this book are available here

Related Topics

Tneary Author
wrote...

4 years ago
Thank you, thank you, thank you!
wrote...

Yesterday
You make an excellent tutor!
wrote...

2 hours ago
Thanks
New Topic      
Explore
Post your homework questions and get free online help from our incredible volunteers
  751 People Browsing
Related Images
  
 237
  
 137
  
 174
Your Opinion
Which is the best fuel for late night cramming?
Votes: 146