initializing using class object method