Create javacode

its the implementation of problem in java