some commons code write in java