The Sample2Test runs and compile successfully and gives the
following output :

Hello

Reason :

To understand the reason, you need to look at the code just before the class
Sample and Sample2 actually get compiled :

Sample.java(After Unicode newline character conversion)

public class Sample {
// Character a = new Character('
');
}

Sample2.java(After Unicode newline character conversion)

public class Sample2{
// Character a = new Character('
{System.out.println("Hello");}
}

As you can see the Unicode newline character(\u000d) change the code by
create a new line where it was placed. That's why it gives error. While in the
case of Sample2 class it is still correct after creating new line
(where it was placed).

I think it will give you a clear idea that the precision must be taken
before using Unicode newline character.