Write a java statement to create an object HONDA in class CAR
Answers
Answered by
0
Answer:
java statement to create an object.
Answered by
8
- 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