basic java codes for public use