how to write a progam in java