# ashok devaram

Greenhorn
since Oct 25, 2005
Cows and Likes
Cows
0
In last 30 days
0
Total given
0
Likes
0
0
Total given
0
Given in last 30 days
0
Scavenger Hunt
Ranch Hand Scavenger Hunt
Greenhorn Scavenger Hunt

## Recent posts by ashok devaram

Thank you very much kakkad.I got the point!
13 years ago
hai mahi,
i am extreamly sorry,my explanation seems to be wrong buddy.
This time i have some other explanation which is as follows:-

My explanation applies when u have like this: (IntegerValue<<NegativeInt)

just add 32 to the NegativeIntValue. (integers have 32 bit length..)
then u wil get new shift distance which may or may not be positive.
if u still get negative distance ,agin perform the addition on the new shift distance.Perform the above step until u get positive distance.

Example:-

2<<-10

now 2<<22 = 2 * 2 power 22= 8388608 (which is "somethingelse" as u said).

hope this is write........ashok( emantav anna!)
13 years ago

String s1=new String("ashok");//1
String s2="reddy"//2

how many string objects are created at line 1?
how many string objects are created at line 2?
if created where they r created?
13 years ago
I have a doubt on the number of string objects created in the following code. I got this from Kathy's programmer cert book.
The question is how many string objects are created in the following code

String s1 = "spring";
String s2 = s1 + "summer";
s1.concat("fall");
s2.concat(s1);
s1 += "winter";
System.out.println(s1 + " " + s2);

plz i need some detailed explanation!

13 years ago
u did not override the equals() of objest class ,so default behaviour of equals method is as follows:-

"The equals method for class Object implements the most discriminating possible equivalence relation on objects; that is, for any non-null reference values x and y, this method returns true if and only if x and y refer to the same object (x == y has the value true)."

in ur code a and b are two different objects,so a==b results in false.
13 years ago
class Test
{
public static void main(String args[])
{
Byte b1=new Byte("127");
if(b1.toString()==b1.toString())
System.out.println("true");
else
System.out.println("false");
}
}
when attempt to run this code ,the output shown is "false"
can u clarify me why it is printing "false".
13 years ago