Simple java codes which can be reused.