Computer Science, asked by annanicole2019, 6 months ago

Write a java statement to create an object HONDA in class CAR

Answers

Answered by infoattariya
0

Answer:

java statement to create an object.

Answered by SmudgeJasmine
8

\huge\boxed{\fcolorbox{black}{pink}{Answer}}

  • Cars is the class name.
  • audi is the object name
  • new is a keyword which is used to dynamically allocate memory for an object and return a reference to it (reference here means address of object in memory) . The memory is allocated in heap area.
  • Cars() is the default constructor call. We will see constructors in upcoming section. Now just understand that this statement will initialize the fields of an object.

HOPE THIS HELPS YOU DEAR

Similar questions