added sample code for raising exception virtually or statically