1. First program doesn't exist a state whose i = 0. Second program can only return first 0 in x.
2. x = null Expected = Null PointerException
x = null Expected = Null PointerException
3. x = [2] Expected = -1
x = [2] Expected = -1
4. x = [2, 3, 5] ; y = 5 Expected = 2
x = [0, 1, 2] Expected = 0