Added Java Code

This is the Java Code that I want to implement in C#