This week's giveaway is in the EJB and other Java EE Technologies forum. We're giving away four copies of EJB 3 in Action and have Debu Panda, Reza Rahman, Ryan Cuprak, and Michael Remijan on-line! See this thread for details.
If u check line 1... return c1; an implicit cast is put there 2 convert char to byte. this is because c1 is a compile time constant... (its value is known at complie time ie final char c1='\u001')
but in the case of line 2... there is a problem cause c2 is not a compile time constant... it is a definately a constant, but its value is not known at compile time.. as it is an argument to a method its value can change therefore the compiler complains at line 2.