Program on Java, creats and sorts some ojects