It's not a secret anymore!
The moose likes Programmer Certification (SCJP/OCPJP) and the fly likes Doubt???? Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login

Win a copy of Java Interview Guide this week in the Jobs Discussion forum!
JavaRanch » Java Forums » Certification » Programmer Certification (SCJP/OCPJP)
Bookmark "Doubt????" Watch "Doubt????" New topic


Kasak Tahilramani
Ranch Hand

Joined: Apr 06, 2006
Posts: 45

ANs:1 with input 'A' output is 1
2 with input 'X' output is 0
3 with input 'D' output is 0
4 method fails to compile.

Myquestion: explain with detail,not able to understand...

[HENRY: Added Code Tags]
[ January 22, 2007: Message edited by: Henry Wong ]
Anton Uwe
Ranch Hand

Joined: Jan 10, 2007
Posts: 122
Think about this code...
fred rosenberger
lowercase baba

Joined: Oct 02, 2003
Posts: 11957

What exactly do you not understand? what output do you think it should give?

Or is there a specific line/syntax you do not understand?

There are only two hard things in computer science: cache invalidation, naming things, and off-by-one errors
Bijendra S. Rajput
Ranch Hand

Joined: Sep 19, 2006
Posts: 41
hi ,

I think the ans of this question is very simple. Whenever there is a comparison between two char with compound operator, actually we have to compare there unicode values.

So the ans is 1 and 2--------------
1 with input 'A' output is 1
2 with input 'X' output is 0

both are correct.

Please correct me if I am wrong.

Thanks <br /> <br />Regards,<br />------------------------------<br />Bijendra S. Rajput<br />SCJP 1.5<br />------------------------------
I agree. Here's the link:
subject: Doubt????
jQuery in Action, 3rd edition