Jump to content

Core Java Lo Experts ..


Recommended Posts

Posted

[quote name='bujjulu' timestamp='1380075055' post='1304300518']
this is current object.
[b]this key word ante when you create an instance of a class in the same class you can refer all variable by this[/b]
u can also refer constructors by this
also methods by this. This is for that object in which the sangarshana is going on at that time. This mean current object
Super means super class this object

[img]http://mars.jpl.nasa.gov/msl-raw-images/msss/00402/mcam/0402ML1666003000E1_DXXX-br.jpg[/img]

manm mars lo rayi ni mars rayi antam
Kani mars emantadhi naa rayi or this rayi ani
[/quote]


[b]manm mars lo rayi ni mars rayi antam
Kani mars emantadhi naa rayi or this rayi ani[/b]
Wonderful explanation. In Class A { }, I am writing this.name = name. As the JVM is creating the object before it is executing this method in class A, it knows that [b]this.name[/b] belongs to object of class A.
But I never know we can invoke methods using "this"

Posted

[quote name='bujjulu' timestamp='1380076330' post='1304300607']
endhuku this ani vadatham thelsa
manaki java lo class owned variables untai vatini static antam
static kani vatini aa class lo variable ni kani , method ni kani, constructor kani, manam this.xyx ano leka this(a,b,c) or this.method ani refer chestham

[b]ante this anedhi object owened when referring its own members[/b]

Vere clas lo aithe
A a = new A(a,b,c);
a.xyx
or a.mothod antam

ikkada twist chusara
manam a.construcotr anakudadhu
adhi alread A a = new A() ane tappudu aa constructor call authadhi

katha bagundha?
[/quote]

Thanks for putting things in a way 100 people can understand
You are the DB guru of JAVA.

Posted

GP

Pl refer java thread for more info and if possible post ur queries knowledge there ....so that we can keep on LTTing and pinky can help us with CITI#H@ sHa_clap4

Posted

[quote name='manmadudhu' timestamp='1380076242' post='1304300597']
eee java lu software lu ante ento peru vintane ekaralaki ekaralu tadipotayi naaaku....naa chem job kanna nenu inkem cheyalenu :3D_Smiles:
[/quote]
think_ww think_ww %$#$ %$#$

Posted

[img]https://lh3.googleusercontent.com/-Q4W4gLTIknk/UcO4LboibfI/AAAAAAAAAN0/qHxoXU6CzTk/s320/shahbash-o.gif[/img]

Posted

[quote name='javakid' timestamp='1380074077' post='1304300441']
[u][color=#000000][font=Arial,]Within an instance method or a constructor, [/font][/color]this[color=#000000][font=Arial,] is a reference to the current object — the object whose method or constructor is being called. You can refer to any member of the current object from within an instance method or a constructor by using this.[/font][/color][/u]



Naku ardaminantha varaku, in a setter method, we say something like
this.name = name;

In my understanding, [b]this.name [/b]referes to the instance variable and [b]name [/b]refers to the argument parameter.
But, the above underlined statement, says that [b]this [/b]is a reference to the current object.
What does it mean to us ? If it is a reference to the current object, what we ll get out of it ?

Please help.
JK
[/quote]



But, the above underlined statement, says that [b]this [/b]is a reference to the current object.
What does it mean to us ? If it is a reference to the current object, what we ll get out of it ?

[b]Q1)But, the above underlined statement, says that this is a reference to the current object.
What does it mean to us ?[/b]

Ans: current object ki memory lo oka address untadi something like #627282
so mana this ane variable lo ee address vostadi when this is used , and so we can modify the object at that point in runtime
so thats why "this" is always a reference



[b]Q2)If it is a reference to the current object, what we ll get out of it ?[/b]

Ans: If it is a reference we can make changes to that object directly in the memory;

Let me know if you have more questions i can explain clearly

×
×
  • Create New...