I thought bad thing would happen when I ended a line like this. But compiler didn\'t even complain. Does anybody have an idea, why this is legal in java.
Compiler wont complain even when you just create an empty file with .java extension. Its an empty compilation unit and its valid. Same way a semicolon is an empty statement which is valid.