Adding samples for java

In this commit, added samples for java.