Question OOP-CLS-0003
EasyWhich keyword creates an object in Java and C++ (on the heap)?
- A.
new
- B.
create
- C.
Show answer and explanation
Answer: A
new allocates memory for the object and calls its constructor.
Popular companies
Prepare company by company
Hiring pattern, syllabus, past questions and mocks for each company.
All companiesPractice by subject
Classes and Objects question
Which keyword creates an object in Java and C++ (on the heap)?
new
create
Answer: A
new allocates memory for the object and calls its constructor.
make
object