I have the following Java program that Eclipse gives a red cross on its left, yet the program compiled well in Eclipse!
Apparently, Eclipse thinks that 'y' may not be initialized so it rejects the program a priori, but the compiler seems more tolerant.
My question is, how to set the compiler option of Eclipse so that it rejects this program?
Check your Java Compiier "Errors/Warnings" preferences, specifically at the bottom where it says to treat errors as if they were fatal.