Object Creation

  • Objects are created by instantiating the class.
  • An Object can be created using ‘new‘ Keyword
creating Object
  • In the above example a new object Benz is created by instantiating a class ‘car’
Object creation involves 3 steps
  • Declaring type of data
  • Creating memory space to save the object
  • Initializing the attributes in the object