It looks like you are declaring a class MainClass and inside the static member function main trying to initilization and create the object of the same class.