[HENRY: Added Reference. Change title id as requested]
SCJP 6, OCMJD 6, OCPJWSD 6
I no good English.
Sahil Kapoor
Ranch Hand
Joined: Sep 12, 2009
Posts: 316
posted
0
Dude please do follow the Rules....If possible
Use ID3 instead of ID2
I have already posted ID2.......... i mean before you posted it !!!
You can just change the ID number to 3 in subject line !!!
Thanks for encouraging the concept !!!
Cheers!!!
SCJP 6.0 96%
(Connecting the Dots ....)
Sahil Kapoor
Ranch Hand
Joined: Sep 12, 2009
Posts: 316
posted
0
Compilation Error :- I think ^(XOR) can be applied to integers only ~~!!!
Martin Vanyavchich
Ranch Hand
Joined: Sep 16, 2008
Posts: 241
posted
0
Sorry about the ID, when I started to post, your thread wasn't up yet. I will try to change it
... and your answer is correct, while the explanation isn't . The '^' XOR can be applied to booleans.
Ulf Dittmer
Marshal
Joined: Mar 22, 2005
Posts: 35248
7
posted
0
Please leave the name out of the subject - it's long enough as it is. What's more, the name is visible wherever the topic title is visible, so it's redundant to begin with.
Ulf is right. We could shorten the titles to just "ID# SCJP QOTD" since all othed info is visible wher you select the thread
Sahil Kapoor
Ranch Hand
Joined: Sep 12, 2009
Posts: 316
posted
0
Ulf Dittmer wrote:Please leave the name out of the subject - it's long enough as it is. What's more, the name is visible wherever the topic title is visible, so it's redundant to begin with.
Okay i agree, we would leave the name of an author from now onwards , but please do keep the date , inspite of being redundant, it looks attractive !!!
Sahil Kapoor
Ranch Hand
Joined: Sep 12, 2009
Posts: 316
posted
0
If XOR can be applied to booleans
then
Compilation error is on line 12
as (short+short) is solved to (int)
and then int cannot be applied to short again without the explicit cast.
So we could do the following :-
Peter Taucher
Ranch Hand
Joined: Nov 18, 2006
Posts: 174
posted
0
The code doesn't compile. But if you'd cast the result of the addition / subtraction to short it would be '100'...
Censorship is the younger of two shameful sisters, the older one bears the name inquisition. -- Johann Nepomuk Nestroy
Martin Vanyavchich
Ranch Hand
Joined: Sep 16, 2008
Posts: 241
posted
0
Sahil and Peter got it right! I'll try to make it more of a challenge the next time