What can you do to make the following code compile?
public class Main { public static void main (String [] args) { int [] values = { 10, 20, 30 }; for ( /* put code here */ ){ } } }
Select 2 options
Correct Options are : A D
Option C. is wrong since k must be initialized first.
So it should be: int k=0; k<0; k++
Option D. will cause an infinite loop, but it is valid.
Option E. is wrong. k needs to be declared first.