How to create an object from Class?

Home Masters of Computer Science How to create an object from Class?

Last Updated on by ICT Byte

To create object in OOP, there are three steps.

Step 1: Declaration object type and variable

  • Declare a variable with variable name
  • Declare object type

Step 2: Instantiation using keyword “new”

  • The “new” keyword is used to create object

Step 3: Initialization of the object

  • “New” keyword is followed by call to a construction
  • This step initializes the new object

Also Read: