some Classic Java codes