Lidija Sketa

Greenhorn
+ Follow
since Nov 12, 2008
Merit badge: grant badges
For More
Cows and Likes
Cows
Total received
In last 30 days
0
Forums and Threads

Recent posts by Lidija Sketa

Hi,

I didn't manage to resolve the problem so I did a workaround: I changed WSDL from which AXIS2 creates Java classes.

I created a new definition for ArrayOfAnyType that contains a string:


Then I changed all necessary values of type ArrayOfAnyType into ArrayOfStringValue.

I don't use XmlObject anywhere in the code. Another way to execute queries is by xml fetch:

.. where fetchS is composed XML string.

Regards,
Lidija
15 years ago
Today I passed the exam with 84%!

I would like to thank to all of the ranchers - this forum was a great knowledgebase for me. I appreciate the help and time everyone invest in helping those of use who are still learning.

I started reading KS & BB SCJP 5.0 book on april this year. But it was only 3 weeks ago that I decided I have to finish this now. So that's about the time I started to learn quite extensively. You can imagine I was sorry I didn't learn more before. So these three weeks were quite tense. Besides my full-time job there was only SCJP in my life. Everything else was on hold.

My appartment looks like mess and I'm lucky enough my boyfriend supports me and did at least the urgent matters around the house and constantly prepared green tea for me when I was to sleepy to learn anymore.

I would also like to thank to Devaka - his simulator was of great help for me. I made his final exam yesterday and passed with 66%, so that was quite a relief as you can imagine. This was actually a reason I went to bed early yesterday (and I read KS & BB pointers at the beginning of the book again - it proposed the same thing) and had 9 hours of quality sleep.
I actually had 2 completely identical questions on today's exam and some very similar ones to Devaka's questions.

The first thing I'm gonna do now is buy a drink to everyone around me. Then I will watch at least three StarTreks in a row, uninterruptingly.

Thanks again, everyone :-)! Keep up the good work.
16 years ago
Ooh, it's calling interrupt on a! I completely overlooked that fact, although for a second it looked suspicious

Thanks for clearing the confusion.

About the next statement that happens right after the thread.start() call: can we be sure that run() method will not execute right AFTER this call but rather will the next statement in the method?
In other words: in the previous example how can we be sure that doDelay(100); will execute before t.doDelay(1000)?
This is from Devaka's ExamLab practice 3 mock exam (thank you Devaka for this great simulator!).

I modified the code a little bit and added printouts but I still don't get it - why doesn't call to a.interrupt() cause InterruptedException?



The output is:
Thread main started sleeping
Thread Thread-1 started sleeping
Thread main stopped sleeping
Calling interrupt
After call to interrupt
Thread Thread-1 stopped sleeping
Ex-B

And another thing:


How can we be sure that the first thing after call to t.start() will be doDelay(100)? Why isn't the first thing that is being executed the code in thread's run method?
Right, Punit is correct.

No need to implement the method since it is not abstract.
You cannot instantiate abstract class. You have to extend it and implement its methods.

You can do it like this:

I would agree with the above answer:



To fulfill the hashCode contract the hashCode() method should always produce the same result for the same object.
I don't think the contract says anything about effectiveness.
This actually outputs the following:

Name in the Constructor >>>Joker
male in the Constructor >>>false
Name in the Class >>>Mukesh
male in the Class >>>true

This is ok, since the parameters are being re-set to their value in the constructor.
Of course.
What I need to remember for now is that it just isn't allowed.
I thought the compiler should check that the class is not final but that's obviously not the case.

Thanks Jamie.
OOooooh, ok .

So it could work, but it isn't allowed to, because it's useless.

Thank you Henry!
This is from etattva exam:



Since String is final - how can this compile?

I was under the impression it's not possible to use ? extends with final classes since no class can extend them.

This is also stated in the topic here.
Ok, that makes sense.

Thank you Ankit.
This question is from etattva exam.

I can't seem to find the logic behind the scenes:


The code doesn't compile. Why is <T super Number> forbidden in class type declaration, but <T extends Number is ok?

If I would instantiate GenericWay with:

In runtime the code should be translated to:


Why isn't this correct?
[ December 13, 2008: Message edited by: Lidija Sketa ]
Ah, thanks Chandra, I overlooked that.

So the conclusion is:
- Map replaces duplicates
- Queue's offer() returns false if the same element is already contained and doesn't replace it
- Set's add() returns false if the same element is already contained and doesn't replace it
- List's add() always returns true

None of them throw Exception if the element is already contained in the collection. I obviously misinterpreted what I read.