wood burning stoves 2.0*
The moose likes Cattle Drive and the fly likes args[ 0 ] != someInput Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of OCA/OCP Java SE 7 Programmer I & II Study Guide this week in the OCPJP forum!
JavaRanch » Java Forums » This Site » Cattle Drive
Bookmark "args[ 0 ] != someInput" Watch "args[ 0 ] != someInput" New topic
Author

args[ 0 ] != someInput

Donald R. Cossitt
buckaroo
Ranch Hand

Joined: Jan 31, 2003
Posts: 401
Why does this snippet not do what it seems it should?

TIA
doco


doco
Jim Yingst
Wanderer
Sheriff

Joined: Jan 30, 2000
Posts: 18671
Try this:


"I'm not back." - Bill Harding, Twister
Marilyn de Queiroz
Sheriff

Joined: Jul 22, 2000
Posts: 9048
    
  10
Most of the time you want to use equals() for objects and save == and != for primitives.


JavaBeginnersFaq
"Yesterday is history, tomorrow is a mystery, and today is a gift; that's why they call it the present." Eleanor Roosevelt
Donald R. Cossitt
buckaroo
Ranch Hand

Joined: Jan 31, 2003
Posts: 401
Thanks guys - oops you too Marilyn I was sure I tried object.equals() and for some reason had a problem but it works fine now. I guess I just wasn't holding my mouth right (jutht a bit of a lithp)
When you get my two 'C' notes I can submit my code - right?
doco
Pauline McNamara
Sheriff

Joined: Jan 19, 2001
Posts: 4012
    
    6
Originally posted by doco mastadon:

When you get my two 'C' notes I can submit my code - right?
doco

Yep, that's usually how it works. You'll probably hear from someone after your payment gets through the mail room, sent up to sorting, then on to accounting, back to educational administration services... ...assuming, of course, that the computers aren't down today.
Barry Gaunt
Ranch Hand

Joined: Aug 03, 2002
Posts: 7729
Of course it will also have to be spent so there's no way to get it back to you


Ask a Meaningful Question and HowToAskQuestionsOnJavaRanch
Getting someone to think and try something out is much more useful than just telling them the answer.
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: args[ 0 ] != someInput