0

I dont know why this output come like dis Abc@2a139a55

https://code.sololearn.com/cI52j6EYXkdw/?ref=app

12th Jun 2018, 3:52 PM
Harsh Agrawal
Harsh Agrawal - avatar
16 Respuestas
+ 8
Harsh Agrawal you passed an object and printed the interger value attached to it. That is the address.
12th Jun 2018, 4:03 PM
Manual
Manual - avatar
+ 6
Here is an example added to your code https://code.sololearn.com/cL93N69wsFC7/?ref=app
12th Jun 2018, 4:06 PM
Manual
Manual - avatar
+ 5
I belive you printed the address of the object.
12th Jun 2018, 3:56 PM
Manual
Manual - avatar
+ 5
"this" gets the current object memory address
12th Jun 2018, 4:10 PM
Manual
Manual - avatar
+ 4
Harsh Agrawal press the checkmark on Donna 's answer
12th Jun 2018, 4:09 PM
Manual
Manual - avatar
+ 4
Harsh Agrawal when you try to print the reference variables.. so our complier automatically invoke "reference variables. toString ()" toString () is method of Object Class.. so in toString() code is return to give us the hashcode.. note in java we cant determined the address of object or not even class. if we try to print toString () method invoke and its return us the hashcode.. As you know that object is a parents of all class so in case of String class object is also a parents of String class so toString ()method of object class is overriden there and in that function the code is written to takeout the value store in the object i.e we see the ans for eg String s="hello"; s is also a reference variables of String class type so when you try to print s the toString method of String class invoke the overriden of toString () is invoke.. that why we see ans hello not hash code.... one last question do you know how to do javadoc if know tell me and if you dont asked..
12th Jun 2018, 4:36 PM
Arun Tomar
Arun Tomar - avatar
+ 4
Harsh Agrawal if you know how to do javadoc. you see all the classes and function of java. what function do what is return type and so many things
13th Jun 2018, 9:21 AM
Arun Tomar
Arun Tomar - avatar
+ 4
Harsh Agrawal are you at discord if you not join it okkk Kirito#2314
13th Jun 2018, 1:59 PM
Arun Tomar
Arun Tomar - avatar
+ 2
thnxxxx both of u!!!! as this is a keyword which is used to reference d variable
12th Jun 2018, 4:11 PM
Harsh Agrawal
Harsh Agrawal - avatar
+ 2
Arun Tomar no bro i dont know javadoc but why did u asked????
13th Jun 2018, 3:52 AM
Harsh Agrawal
Harsh Agrawal - avatar
+ 1
Manual bro this is not my code as i just checking other code den i see dis code n i get stuck on seeing d output So is it dis output address???
12th Jun 2018, 3:57 PM
Harsh Agrawal
Harsh Agrawal - avatar
+ 1
Donna and Manual thnxxxxxx bro!!!!!
12th Jun 2018, 4:06 PM
Harsh Agrawal
Harsh Agrawal - avatar
+ 1
Manual In ur program why u use this?????
12th Jun 2018, 4:08 PM
Harsh Agrawal
Harsh Agrawal - avatar
0
can u give me link so i can join it!!!Arun Tomar
13th Jun 2018, 2:40 PM
Harsh Agrawal
Harsh Agrawal - avatar