Welcome to Scribd, the world's digital library. Read, publish, and share books and documents. See more
Download
Standard view
Full view
of .
Save to My Library
Look up keyword or section
Like this
35Activity
0 of .
Results for:
No results containing your search query
P. 1
Java Puzzlers

Java Puzzlers

Ratings:

4.4

(20)
|Views: 15,714|Likes:
Published by me
java puzzlers from javaone 2007
java puzzlers from javaone 2007

More info:

Published by: me on Jun 22, 2007
Copyright:Attribution Non-commercial

Availability:

Read on Scribd mobile: iPhone, iPad and Android.
download as PDF, TXT or read online from Scribd
See more
See less

03/26/2013

pdf

text

original

 
2006 JavaOne
SM
Conference | Session TS-1188 |
The Continuing Adventures of
Java 
™ 
Puzzlers 
: Tiger Traps
Joshua Bloch and Neal Gafter
Google Inc.
TS-1188
 
2006 JavaOne
SM
Conference | Session TS-1188 |2
Introduction
Eight more Java
platform puzzles
Short program with curious behaviorWhat does it print? (multiple choice)The mystery revealedHow to fix the problemThe moral
Covers language and core librariesWatch out for Tiger traps!
 
2006 JavaOne
SM
Conference | Session TS-1188 |3
1. “Odd Behavior”
 public class OddBehavior{ public static void main(String[] args) {List<Integer> list = Arrays.asList(-2, -1, 0, 1, 2); booleanfoundOdd= false;for (Iterator<Integer> it = list.iterator(); it.hasNext(); )foundOdd= foundOdd|| isOdd(it.next());System.out.println(foundOdd);} private static booleanisOdd(inti) {return (i & 1) != 0;}}

Activity (35)

You've already reviewed this. Edit your review.
1 thousand reads
1 hundred reads
akhileshchafale liked this
Eric Moore liked this
xploreraj added this note
yeah...needed it. puzzlers
Rahul Yadav liked this
davidroy123 liked this
sasha_ne liked this
parameswarar liked this

You're Reading a Free Preview

Download
/*********** DO NOT ALTER ANYTHING BELOW THIS LINE ! ************/ var s_code=s.t();if(s_code)document.write(s_code)//-->