Lata Bagga

Ranch Hand
+ Follow
since Jun 13, 2007
Merit badge: grant badges
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
expand Ranch Hand Scavenger Hunt
expand Greenhorn Scavenger Hunt

Recent posts by Lata Bagga

Thanks Merril for the solution. But I am getting an error in jsp saying that "value" attribute is required. Please help me out, I need it urgently.
15 years ago
Hello friends,

I am new to Struts.I want to iterate over the Hashmap and save its "key" in the radio button as:


Here AddressMap is the HashMap.
What should I give the value to the "value" attribute of the radio button so that I can have the "key" of HashMap i.e AddressMap or should I use <html:radio> tag. Could anyone please help me out?
15 years ago
Hello Friends,

Finally I passed SCJP 5.0 with 95%. I would really like to thanks all the java ranchers to be a memeber of such a nice discussion forum and helping others in their doubts. This forum was really very helpful in my preparation of SCJP exam. One more thing the book of "Kathy Sierra and Bert Bates" is really like a blessing, its not only helps you in clearing SCJP 5.0 exam but also many concepts which I would have never noticed. I would like to give special thanks to them.
Those who are in preparation stage I would like to say them read thouroughly "Kathy Sierra and Bert Bates" and give lot of mock exams. I gave many mock exams and then referred "KS & BB" again and again for those particular concept in which I was doing mistake.

Thanks and Regards,
Lata
16 years ago
Hello friends,

I am new to JSF and was stuck with a question of JSF in brainbench certification exam. Can anyone give me the answer of this question:


Regards,
Lata
16 years ago
JSF
Hello friends,

Last week I completed SCJP 5.0(with 95%) and now was looking for job and my interviewer ask me to give Brainbench certification exam but I don't have much knowledge in J2EE. Please help me with the following question:



According to me the answer should be d but i am not sure. Can anyone tell me the correct answer for it?
Hello Friends,

I have doubt in the following code:


The output comes as:
null
Dog key
null

I am not able to understand why the line 6 is giving o/p as null.
My understanding for above code is:

This thing I understood that when d1.name is set to "magnolia"in line 1, then line 2 prints null beacuse the d1 object saved earlier in the map has name as "clover" . So the hashcode will be 8 but earlier it was 6.

But when line 5 changes d1.name as "arthur", but line 6 is printing the
dog object whose name is "clover" which was saved into the map, so the hashcode() will be 6 and equals should also satisfy, then why it is not returning "Dog key" instead of null.
I think I am not getting the logic of line 1 - line 6. Can anyone clarify my doubt?

Regards,
Lata
Hello Friends,

I have doubt in the following regex question:


Answer is E i.e. 01234456.
But what I think the answer should be 0123445 instead of 01234456. Can anyone explain me why in the output we are having an extra 6?

Regards,
Lata
Hello,



By running the above code, the compiler gives error in "line 1" saying that "cannot convert from int to byte". It's fine, but when I compile the other way as:


Now it is not giving any error. I can't understand why its not giving any error here. Please help me.

Regards,
Lata
Thanks to all now I got the concept. Sunny you cleared all my doubts regarding this question. Thank you so much!!
Hello Friends,

I have doubt in the following code:



I am not able to understand:
1) why A option gets compiled, how the findLarger(T x, T y) accept 123 and "456" even though both are different, one is Integer and other is String.According to me both the arguments should be same.

2) Why option B is giving compiler error as: "Type mismatch:cannot convert from Number&Comparable<?> to int".

I think I am not able to get the correct concept of this statement "public <T extends Comparable> T findLarger(T x, T y)" . Can anyone clarify my doubt?

Regards,
Lata
Hello Cathymala,

Earlier I had the same doubt in this question but I got this explanation from Vishwanath which cleared my doubt and hope will clear yours also:

for the first value in the array:
arr[1]<-- 0
so arr becomes,
{1,0,3,4}

for the next value in the array: [Remb: The array is changed now]

arr[0]<-- 0;
and arr is now,
{0,0,3,4}

for the next value in the array:

arr[3]<--0
gives
{0,0,3,0}

and for the last value in the array:
arr[0]<--0
so, arr remains {0,0,3,0}


Regards,
Lata
Hello Friends,

I have doubt in the following question which is Q no. 16(Chapter 7) from KS & BB of Generics and Collection:



I am not able to understand why option C is not correct. As the return type is List<? super E> and if E is an Integer then List<Number> should work for it.
Can anyone help me with it?

Regards,
Lata

System.out.println(x + y + foo());



The expression "x+y+foo()" in println is evaluated from left to right.

If either operand is a String, the + operator becomes a String concatenation operator. If both operands are numbers, the + operator is the addition operator.

So, as x and y are numbers(long) they get added and gives 86 and after the result of addition, we are left with 86 and other String operand("foo") which gets concatenated resulting in to: 86foo.
Thanks a lot!! I got it now.