I am not able to understand the logic behind this.
Can somebody help me out..?
This is why when you have compile errors, you have to fix the first couple, and then recompile. When the compiler encounters an error, it gets confused after awhile.
One error can chain react into many other compiler errors later in the program. Or one error can actually mask another error. In this case, all 4 lines are compile errors, but it looks like the compiler gets comfused and missed the fourth one.
Don't worry about it. Once you fix the eariler ones, it will eventually catch the fourth one.
Henry