General programming in Java