+ 1
Explain the usage of hello while creating the object in the below code?
6 Réponses
+ 5
Nagaraj P [ Inactive ] We create the object of the class using new keyword so here in this code we have created a object of the reference class Hello. By using that object we are printing the value.
+ 3
The Hello on LHS is the reference and the Hello on RHS is a constructor call.
It means that your object is of Hello type and it needs to make a call to the constructor for the object to get created of that class.
+ 3
🅰🅹 - ɪ'ᴍ ᴄʀɪᴍɪɴᴀʟʟʏ ɢᴏᴏᴅ! Thank you so much Brother. ❤️🌟
+ 3
Avinesh thank you brother understood that thing...🌟
+ 2
Your object is of the reference type so it helps in accessing the members of the class of which the reference has been created.
+ 1
Avinesh Thank you but again a question How the reference (Hello on LHS) works along with the object...