Ioana, Welcome to Javaranch The code compiles fine on my machine. What a = b = c = d = 'a' does is perfectly legal. 'a' is a char literal which gets assigned to d (a char primitive variable). d gets in turn assigned to c which is an integer primitive variable. Assigning a char value to an int variable is legal (widening primitive conversion). c gets in turn assigned to b which is a float primitive variable. Assigning an int value to a float variable is legal (widening primitive conversion) b finally gets assigned to a which is a double primitive variable. Assigning a float value to a double variable is legal, too. (widening primitive conversion). Could you please make sure that the code you posted matches the one you are compiling. Also, what version of JDK are you using (java -version)?