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:

More From Author

Structured Programming Vs Object-Oriented Programming – OOP

What is encapsulation? Learn encapsulation in JAVA

ICT BYTE is the ultimate youth-centric destination for tech news in Nepal. Delivering timely updates on the tech landscape within Nepal and beyond, it offers comprehensive coverage, in-depth analysis, and product reviews.