Question: What would the code segment in Listing 1 output? Listing 1: Code Segment 1 static final int SIZE = 7; 2 int [] sequence =
What would the code segment in Listing 1 output? Listing 1: Code Segment
1 static final int SIZE = 7;
2 int [] sequence = new int [ SIZE ];
3 int i ;
4 sequence [0] = 0;
5 sequence [1] = 1;
6 for ( i =2; i < sequence . length ; i ++)
7 sequence [i] = sequence [i -1] + sequence [i -2];
8 System . out . println ( Arrays . toString ( sequence ));
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
