How to define and use Class