Shikha Sood

Greenhorn
+ Follow
since Jan 24, 2001
Cows and Likes
Cows
Total received
0
In last 30 days
0
Total given
0
Likes
Total received
0
Received in last 30 days
0
Total given
0
Given in last 30 days
0
Forums and Threads
Scavenger Hunt
expand Ranch Hand Scavenger Hunt
expand Greenhorn Scavenger Hunt

Recent posts by Shikha Sood

Hi ketan,
The Strings are immutable means that u cannot change the value of a string object once assigned.
When ever u do ne kind of operations of String objects u always get a new String.
That's why the when u r printing the value of s1 it's giving "aaa" because concat method results in a new string
so if u want that the value of s1 should be changed
then u have to assign the string formed to the s1
as
s2 = s1.concat"bbb");
s1=s2;
or s1 = s1.concat("bbb");
hope this helps u.
thanx
Hi
Hello rajani adapa
U r getting the output as different because u r making two obejcts of the same class which are two different reference
so when u will
compare they will refer to different address locations.
That's why the output is different values
But as u see the Goalm exm. When u assign one object reference to another object refernce then both becomes alias and refer to same address location.
so if u will do a = b or b = a then u 'll get the output as sames values
Hope this clears ur doubt.
Thanx
Hi swikriti
can u give me some handy tips on how to >> ,<< operators work<br /> what does this statement means 46<<2,46>>2,46>>>2
Kindly explain
thanx
Hi arvind
Congrats!!!
Now u r another java certified champ in the java world
Congrats once again!!!
pretty good score
21 years ago
Hi Basu
Here o is just poiniting to an OBject class.
As Object is the top level class in the heirachy
as java deals in objects. so it's a very general term.
Can nebody help me in understanding bitwise operators.
Even I agree with Priya.KM is better then RH.
As i ave read RH and now i am going through KM.
I am finding KM more descriptive then RH
Hi priya
It still not clear my doubt .can be please elaborate more on this
Thanx
public class MyClass
{
public static void main(String args[])
{

MyClass c = new MyClass();
c.amethod();
}
public void amethod()
{
System.out.println("amethod");
int i = 99;
System.out.println("1" +i);
Valhold v = new Valhold();
v.i=30;
System.out.println("2" +v.i);
another(v,i);
System.out.println("3?" +v.i);
}
public void another(Valhold v,int i)
{
System.out.println("another");
i=0;
System.out.println("4" +i);
v.i=20;
System.out.println("5" +v.i);
Valhold vh = new Valhold();
v=vh;
System.out.println(" 6 " +v.i + "," +i);

}
}
class Valhold
{
public int i=100;
}
Can nebody help me understanding the code .
The output of the code is 100,0,20
I am able to under stand why it prints 100,0 but how cum 20 is being printed in not getting clear to me.
Pl help me out in understanding the underlying concept