Initalising an object with state