g krishnan

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

Recent posts by g krishnan

Hello Lakshmi
I dont have the exact explanation, but i know the reason for the superclass method is being invoked. It is because of the private access modifier, once the flow is inside superclass, it is sort of binded by the private access modifier, to call its method.
Try removing private access modifier and try u will get 1 in the place of 9.
hope this clarifies to certain extent.
Hi Jane,
Adding to what manisha has asked, if Hello already exists in string pool, whether the same is string is pointed to or a new string is created in string pool. This is a ever confusing area, pls clarify.
it is the method of container,
public void add(Component comp,
Object constraints)
Object constraints refers the North, South etc, check with API
Hi Eugene,
StringBuffer doesnt have equals method, u can check out the API.
u can access val thro a object of TestClass only inside a static method like
TestClass obj = new TestClass()
hope this clarifies
hi all are correct except boolean, boolean is not allowed in switch.
sorry couldnt understand the ques. if any part of q is left out or any part of code is left out pls post that also. also give all the ans options if you have.
we dont have to provide the empty parameter contructor in subclass it has to be in superclass, as in subclass, even if we dont insert empty constructor calls, it inserts on its own, and looks for the matching empty parameter constructor in superclass.
hope i've answered ur ques.
1<<31 will result in the following
1000 0000 0000 0000 0000 0000 0000 0000
this is a negative number now, to get the actual value, we will have to get 2's complement.
to get 2's complement, first change 0's to 1s and 1's to 0s, then we get
0111 1111 1111 1111 1111 1111 1111 1111
now addingg 1 to this gives
1000 0000 0000 0000 0000 0000 0000 0000
(which is the same bit pattern as original in this case)
now change this Hex
8 0 0 0 0 0 0 0
so we get 0x80000000
Friends, whether it is on heap or string pool, it still occupies memory correct, which needs to reclaimed, so what is wrong in reclaiming those unused memories of string pool. otherwise string pool will go out of memory after some time.
i welcome explanations which can through further light on the topic.
Hi guys
just imagine u are passing a obj reference here and look at the problem, when u change a obj reference inside a called method and return nothing happens, if u have to make changes then u have to access the instance variables and make changes like obj.i=5; etc then only the changes will reflect. To make changes reflect here in out case u will access i[0] inside the changed method and make the change.
u can run a similar code with objects and clarify your self.
hope i have helped
hi niraj,
I also think what nandini telling is correct. I think any gc action on variables inside a method can start only after the end of method. Guys correct me if iam wrong.
hi ratul
In hex[(b>>4)&0x0f], b is changed to int before shift, which means all 24bits to the left of initial is filled with 1s, then the shift takes place, now the right extreme 4 bits will be filled with 1s, which is ANDed by 0f, which will result in f, now hex[f] is equal to f from array.
Next b is taken again it is ANDed with 0f straightaway without any shifting operation, this result only one at the right most position and all the remaining bits zero, so now what we have is hex[1], which is equal to 1 as per array.
hence the final result is f1. the prefix 0x is added by the string within quotes.
i think this will clarify
Your question itself carries the answer, meaning Gridbaglayout is suitable for any grid form of laying.
i had drawn the diagram and found only "Nick" is not pointed by any of the references, so i think 1 is correct