Update the Java code

Also I update the C# code