Annette Sovereign

+ Follow
since Jul 12, 2005
Merit badge: grant badges
For More
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 Annette Sovereign


Has anyone been able to add new links to the left-hand frame of the main front page for fitnesse?

11 years ago
Hi - is there a drools forum?
16 years ago

I'm trying to do a search that would return results for more than one person in a directory instead of having to make a call for each person on the list.

I am using search(Name name, String filter, SearchControls cons)
and setting the filter to userId=foo,userId=bar but getting nothing back. I'm not sure if this is valid or if I'm using an invalid seperator or worse still using the wrong method.

I'm new to JNDI so please bear with me .

Any pointers would be appreciated.

Thanks for getting back to me.

its hasCode() method not hashcode().

Do you mean its hashCode() method not hashcode(). ()

Sorry to be pendantic but it does have implications for the way the question is answered.

Happy Studying
Hi Neha,

Please can you confirm if there's a typo. Otherwise, please confirm where exactly you got the question from. I've got th K&B book and I'm preparing for SCJP 1.4 and want to make sure we've got the correct answer on this one.

Happy Studying

Can you confirm that there isn't a typo in your snippet of code. Should it read hashCode and not



Happy Studying

I think what your professor is trying to say is that you do not necessarily become a better programmer once you've taken the exam which is true. What the exam does do very well is test your knowledge of the language and I can assure you that there are loads of experienced Java programmers that will fail the exam if they took it without studying.

I'm choosing to take the exam simply for self-development and to evaluate my level of proficiency as it's very easy to convince yourself that you're good at something even if you've not been tested. No one goes for an interview, knowing full well that there will be technical tests without preparing, do they?

Overall, I'd say it shows character and confidence on your part if you choose to take the exam because it means you're keeping your eyes on the market and looking for ways to distinguish yourself amongst the masses. I don't see anything wrong with that. People with that sort of mentality are the ones more likely to take responsibility for their career development instead of waiting for someone to drop some org chart of where they should be in 5 years time. They're the ones more likely to be working long hours (or should I say pretending to be working) when there's word on the street about restructuring cos' they know what they have nothing to offer.

When you're not sure of what you have to offer, you'll be tossed about every time the strong winds blow and strong winds will always come

Keep studying and remain focused. Given that your professor does not work in a commercial environment ...... .... need I say more. If she still insists, tell her to get a copy of "The World is Flat" by Thomas Friedman.

Happy Studying
Is it correct that the since the assignment in line 8 evaluates to true, that conditional test is valid??

See below ...

1. boolean a = true;

2. boolean b = false;

3. boolean c = true;

4. if (a == true)

5. if (b == true)

6. if (c == true)
System.out.println("Some things are true in this world");

7. else
System.out.println("Nothing is true in this world!");

8. else if (a && (b = c))
System.out.println("It's too confusing to tell what is true and what is false");

9. else
System.out.println("Hey this won't compile");
here x++( would make x = -1 as the post o/p @1 would get result)

Hi there,

Thanks for responding.

I'm sorry I'm not sure I understand what the statement means. How x++ would make x become equal to -1 is a mystery to me. I was able to evaluate the expression to 0, but I'm not sure my reasoning is correct.

If someone can break it down, that would be great.

I'm trying to work out when the post increment operator on x is applied.

Happy Studying
public class Static
int x = 5;

static int x,y;
public static void main(String args[])
x--; myMethod();
System.out.println(x + y + ++x);

public static void myMethod()
y = x++ + ++x;

My question is why does "y" in myMethod evaluate to 0.

Happy Studying
Thanks for confirming Chandra. Had me really puzzled there

Happy Studying

can you confirm where you got the question from please?

Quick correction, the object in the snippet I wrote earlier would be declared private and not in the method.

Actually, to implement a singleton, you'd synchronize the method and also first check if the object exists before creating it. See below:

public static synchronized SingletonObject getInstance()
if ( a == null)
A a = new A();
return a;

Happy Studying

Okay - so I decided to have a word with the compiler myself and he/she/it did not complain. So I guessed I must be wrong and the book correct (why isn't there a humble pie smiley??).

Anyway, I think I've figured it out now and know where I went wrong (when answering the question, I reeled off the list of constructors in my head).

Thanks to those that responded.

Happy Studying