Win a copy of Murach's MySQL this week in the JDBC and Relational Databases forum!

since Feb 09, 2001

For More

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

Ranch Hand Scavenger Hunt

Greenhorn Scavenger Hunt

Hi Fei,

So, what is wrong with the above conversion method.

Bala.

So, what is wrong with the above conversion method.

Bala.

22 years ago

Hi Paul,

1) When you have same precedence, the evaluation will be left to right. * and / are in same precedence.

2) 2895729615 = 10101100100110010101001111001111 in binary.

Note that Most Significant Bit has 1 means it is negative.

Bala.

1) When you have same precedence, the evaluation will be left to right. * and / are in same precedence.

2) 2895729615 = 10101100100110010101001111001111 in binary.

Note that Most Significant Bit has 1 means it is negative.

Bala.

22 years ago

An instance of a class is called an object. IE, Object is an instance (of a class).

Bala Arul

Bala Arul

22 years ago

Hi Faisal,

1) Hex to Binary

Convert every digit into 4 bit Binary.

e.g) A6 = 1010 0110

2) Binary to Hex

Group by 4 bits from right to left, then convert each group to Hex equivalent.

e.g) 101011 = 0010 1011 = 2B

3) Oct to Bin and Bin to Oct would have the procedure as above, but with group of 3 bits instead of 4 bits.

4) For Oct to Hex and Hex to Oct, there need to be an intermediate binary conversion. i.e, Oct to Bin to Hex and Hex to Bin to Oct.

Hope that helps.

B Arul.

[This message has been edited by Bala Arul (edited May 08, 2001).]

1) Hex to Binary

Convert every digit into 4 bit Binary.

e.g) A6 = 1010 0110

2) Binary to Hex

Group by 4 bits from right to left, then convert each group to Hex equivalent.

e.g) 101011 = 0010 1011 = 2B

3) Oct to Bin and Bin to Oct would have the procedure as above, but with group of 3 bits instead of 4 bits.

4) For Oct to Hex and Hex to Oct, there need to be an intermediate binary conversion. i.e, Oct to Bin to Hex and Hex to Bin to Oct.

Hope that helps.

B Arul.

[This message has been edited by Bala Arul (edited May 08, 2001).]

22 years ago

Hi Shah,

g.fillRect(52, 53, 50, 50) will use graphics context's current color (I think that is what you mean by ForegroundColor).

Bala Arul.

g.fillRect(52, 53, 50, 50) will use graphics context's current color (I think that is what you mean by ForegroundColor).

Bala Arul.

22 years ago

Hi Tracy,

[] is evaluted first then post-increment ++. That means,

array[i++] yealds array[5] and i = 6.

After this the evaluation of the expression on the right side of the equal sign is performed, and I hope that you are clear on that.

Bala Arul.

[This message has been edited by Bala Arul (edited May 03, 2001).]

Originally posted by Tracy Qi:

I am still confused here.

array[i++] = array[6]

But I think after this operation i is still 5. so how come i = 6?

[] is evaluted first then post-increment ++. That means,

array[i++] yealds array[5] and i = 6.

After this the evaluation of the expression on the right side of the equal sign is performed, and I hope that you are clear on that.

Bala Arul.

[This message has been edited by Bala Arul (edited May 03, 2001).]

22 years ago

Since x is reference of type B(base class), x.x is always refer to the Base integer member x, not the hiding integer member of A.

But when it comes to methods, actual object method would be invoked. That means if A has a over-riding method, that is the one is invoked. If there is none of over-riding method, then the base class method is invoked.

Bala Arul.

But when it comes to methods, actual object method would be invoked. That means if A has a over-riding method, that is the one is invoked. If there is none of over-riding method, then the base class method is invoked.

Bala Arul.

22 years ago

Hi raimondas zemaitis,

I just visited the site and have same probloms as you described.

B Arul

Originally posted by raimondas zemaitis:

I would really appreciate if someone could visit my site and drop me a message if you experience the same

problems.

I just visited the site and have same probloms as you described.

B Arul

22 years ago

22 years ago

Hi Keith,

I hope that the following thread would help.

http://www.javaranch.com/ubb/Forum24/HTML/009073.html

Bala Arul

[This message has been edited by Bala Arul (edited April 04, 2001).]

I hope that the following thread would help.

http://www.javaranch.com/ubb/Forum24/HTML/009073.html

Bala Arul

[This message has been edited by Bala Arul (edited April 04, 2001).]

22 years ago

Answers : -1, -1.

After 1 is left shifted by 31, the high order bit is 1. When this is right shifted by 31, all the 32 bits are 1's. That is -1. In case of i which is again right shifted by 1, still all the bits are 1's. Thus the result.

Bala Arul.

After 1 is left shifted by 31, the high order bit is 1. When this is right shifted by 31, all the 32 bits are 1's. That is -1. In case of i which is again right shifted by 1, still all the bits are 1's. Thus the result.

Bala Arul.

22 years ago

Hi,

As an integer -0's binary representation is as same as 0, by taking 2's compliment.

B Arul.

As an integer -0's binary representation is as same as 0, by taking 2's compliment.

B Arul.

22 years ago

In my opinion, 0.0 is equals to -0.0. Sign only indicates how the zero was achieved, whether from positive or negative value.

B Arul

B Arul

22 years ago

Hi Sunit,

It is all about operator precedence.

First a[i] is computed and printed, where 'i' is (a=b)[3].

To evaluate (a=b)[3], first assign array b into a, then take the subscript [3]. So a and b are denoting the same array { 2, 3, 1, 0 }. Thus i is equal to 0 (a[3] / b[3]). But as I mentioned before, a[i] is evaluated first. So a[0] from original array a ({ 1, 2, 3, 4 }) is printed. If you analyze array a after this 'println' statement, you will find that a referencing the array b ({ 2, 3, 1, 0 }).

Bala Arul.

It is all about operator precedence.

First a[i] is computed and printed, where 'i' is (a=b)[3].

To evaluate (a=b)[3], first assign array b into a, then take the subscript [3]. So a and b are denoting the same array { 2, 3, 1, 0 }. Thus i is equal to 0 (a[3] / b[3]). But as I mentioned before, a[i] is evaluated first. So a[0] from original array a ({ 1, 2, 3, 4 }) is printed. If you analyze array a after this 'println' statement, you will find that a referencing the array b ({ 2, 3, 1, 0 }).

Bala Arul.

22 years ago

Hi Pratiti,

False.

i) String s = "Hello" + "Java"; yields "HelloJava" as the value of s.

ii) String s = "Hello";

String s2= "Java";

s.concat( s2 );

After all the above 3 statements executed, s still refer to the value "Hello". s.concat(s2) does not change the s's value, but return new String object whose value is "HelloJava"

Bala.

False.

i) String s = "Hello" + "Java"; yields "HelloJava" as the value of s.

ii) String s = "Hello";

String s2= "Java";

s.concat( s2 );

After all the above 3 statements executed, s still refer to the value "Hello". s.concat(s2) does not change the s's value, but return new String object whose value is "HelloJava"

Bala.

22 years ago