Very Weird ?

We were writing a crazy program but then we come up with a

really weird thing

String d=Tashak.Edges.get(0).gett();

String b="B";

System.out.println("sdf"+d+"f");

++++System.out.println((Tashak.FindNodeWithName(Tashak.est,"B")));

****System.out.println(Tashak.FindNodeWithName(Tashak.est,d));

the call with the **** sign shows null

however the call with the +++ sign gives result "node@923e30"

which is the right answer

any Ideas Whyit seems the direct input to method as "B" works but

for some reason the otherways don"t

thank u very much

[622 byte] By [NikoNedoEmrea] at [2007-10-2 21:08:57]
# 1
eeee prompt answers will be apreciated we are kind of a trying to fix it right now :)
NikoNedoEmrea at 2007-7-13 23:54:52 > top of Java-index,Java Essentials,Java Programming...
# 2

> ll with the **** sign shows null

> however the call with the +++ sign gives result

> "node@923e30"

> hich is the right answer

Maybe the value of your d variable is null... Anyway, to answer more precisely, you have to show the implementation of the Tashak.FindNodeWithName() method.

What is the value of the d variable?

TheLoosera at 2007-7-13 23:54:52 > top of Java-index,Java Essentials,Java Programming...
# 3
> eeee prompt answers will be apreciated > > we are kind of a trying to fix it right now > > :)Ah.
prometheuzza at 2007-7-13 23:54:52 > top of Java-index,Java Essentials,Java Programming...
# 4
Tashak.Edges.get(0).gett(); returns the string B public node FindNodeWithName(Vector <node> a ,String b){node x=null;int y=0;while (y<a.size()){if(a.get(y).Name()==b){x = a.get(y);}y++;}return
NikoNedoEmrea at 2007-7-13 23:54:52 > top of Java-index,Java Essentials,Java Programming...
# 5

> eeee prompt answers will be apreciated

>

> we are kind of a trying to fix it right now

This kind of comment is not well-received here. People answer questions on their own time. You waited a whole 8 minutes before whining for a faster answer. Next time be more patient and manage your time bette.r

You problem is because you're using ==, rather than equals(), to compare Strings.

jverda at 2007-7-13 23:54:52 > top of Java-index,Java Essentials,Java Programming...
# 6
And, please, next times use [code] and [/code] tags when you post your codes. It will make your code much more readable for us, as it is described in [url http://forum.java.sun.com/help.jspa?sec=formatting]Formatting Tips★[/url]
TheLoosera at 2007-7-13 23:54:52 > top of Java-index,Java Essentials,Java Programming...
# 7
We thank you very much very very much and sorry for that Comment again thank you
NikoNedoEmrea at 2007-7-13 23:54:52 > top of Java-index,Java Essentials,Java Programming...
# 8
> We thank you very much > very very much You're welcome.> and sorry for that Comment No harm done.
jverda at 2007-7-13 23:54:52 > top of Java-index,Java Essentials,Java Programming...