You need to define a class before creating objects.
Tips
usage
对象 has two common senses: (1) 'object' in OOP, (2) 'romantic partner / significant other'. 创建对象 in a tech context unambiguously means instantiating a class — but out of context, 找对象 (find a 对象) means 'find a boyfriend/girlfriend'.