Chapter |
Exercise |
No. |
Title |
Status of completion |
Getting started |
1 |
Extending class HelloWorld |
|
2 |
Working with variables |
|
3 |
A conditional |
|
4 |
A loop |
|
Language Fundamentals |
5 |
Hotel key cards |
|
6 |
Legal variable names |
|
7 |
Benefits of final |
|
8 |
«C» vs. Java. |
|
9 |
Assignment and type safety |
|
10 |
Inventing tinyint . |
|
11 |
An int 's
minimum and maximum value |
|
12 |
Pretty may not be pretty |
|
13 |
Strange output |
|
14 |
Poor mans ASCII table |
|
15 |
Integer value hexadecimal representation |
|
16 |
Binary literals |
|
17 |
Testing the limits (Difficult) |
|
18 |
Why using braces in System.out.println(...) ? |
|
19 |
Composing strings of literals and variables |
|
20 |
Escaping double quotes |
|
21 |
Supplementary string exercises |
|
22 |
int and char |
|
23 |
float vs. double |
|
24 |
int
to char
narrowing problems |
|
25 |
Get a byte from 139 |
|
26 |
Ariane, I miss you! |
|
27 |
Reducing long
to int
(difficult) |
|
28 |
Calculating a circle's area |
|
29 |
Dividing values |
|
30 |
Strange things with operator ++ |
|
31 |
Adding values |
|
32 |
Representational float and double miracles |
|
33 |
Expressions involving infinity |
|
34 |
int to short assignment |
|
35 |
int to short assignment using final |
|
36 |
Calculating a circle's area avoiding accidental
redefinition |
|
37 |
Turning weeks into seconds |
|
38 |
Turning seconds into weeks |
|
39 |
Using predefined Java™ standard library
constants |
|
40 |
Converting temperature values |
|
41 |
Time unit conversion |
|
42 |
Interest calculation |
|
43 |
Summing short and char |
|
44 |
Operator & vs. && |
|
45 |
Strange addition |
|
46 |
Understanding += |
|
47 |
Three ways expressing the same |
|
48 |
Guessing results |
|
49 |
Cleaning up the mess |
|
Statements |
50 |
Providing better display |
|
51 |
Comparing for equality |
|
52 |
Replacing else if (...){...} by
nested if ... else statements |
|
53 |
Post modifying an exam's marking |
|
54 |
At the bar |
|
55 |
Roman numerals |
|
56 |
Leap years |
|
57 |
Why “break”? |
|
58 |
Extending to month days |
|
59 |
Converting day's names to numbers. |
|
60 |
Day categories. |
|
61 |
Roman numerals, using switch |
|
62 |
Generating square numbers |
|
63 |
Calculating factorial |
|
64 |
Even or odd? |
|
65 |
Square root approximation |
|
66 |
Printing numbers |
|
67 |
Printing just even numbers |
|
68 |
Merry Xmas |
|
69 |
More fun with Xmas trees |
|
70 |
A basic square number table |
|
71 |
Tidy up the mess! |
|
72 |
HTML-ify me |
|
73 |
Auxiliary Example, part 1: A multiplication table |
|
74 |
Auxiliary Example, part 2: Avoiding redundant entries |
|
75 |
Creating a “real” square table |
|
76 |
Creating a sophisticated HTML version of your square
table |
|
77 |
Display all summands |
|
78 |
Playing lottery |
|
79 |
Guessing numbers |
|
80 |
Smallest multiple |
|
81 |
Smallest multiple, purely algebraic solution |
|
82 |
Pythagorean triples |
|
83 |
Avoiding duplicates and gaining performance |
|
Objects and Classes |
84 |
Compile time error |
|
85 |
An Address class |
|
86 |
Understanding access control |
|
87 |
Explaining times |
|
88 |
Implementing getter methods |
|
89 |
Method signature variants |
|
90 |
Will a match be found? |
|
91 |
Modeling geometry objects: Rectangles |
|
92 |
Modeling circles |
|
93 |
Adding translations and SVG
export. |
|
94 |
Extending the employee example. |
|
95 |
Refining access to an employee's attributes |
|
96 |
File system representation |
|
97 |
Your personal String class |
|
98 |
Constructors variable names and “this”. |
|
99 |
Class vs. instance |
|
100 |
Distinguishing leap- and non-leap years |
|
101 |
A method for printing square numbers using for , while and do ... while |
|
102 |
Nicely formatting sine values. |
|
103 |
Extending our interest calculator |
|
104 |
Integer value considerations. |
|
105 |
Programmer's favourite expression |
|
106 |
Lotteries revisited |
|
107 |
Finding the greatest common divisor of two integer
values |
|
108 |
Dealing with IBAN numbers |
|
109 |
Cancelling fractions |
|
110 |
Dealing with local Maven dependencies |
|
111 |
DNS inflicted groupId / package names
clashes |
|
112 |
Details on execution |
|
113 |
Maximum and absolute value |
|
114 |
Factorial, the direct way |
|
115 |
Factorial, the recursive way |
|
116 |
Binomials, the recursive way |
|
117 |
The exponential
|
|
118 |
Implementing
. |
|
119 |
Summing up in a different order. |
|
120 |
Summing up integers to a given limit |
|
121 |
Summing up, the better way |
|
122 |
Turning seconds into weeks, part 2 |
|
123 |
Example: A class representing fractions |
|
124 |
Compass directions |
|
125 |
Compass direction neighbours |
|
126 |
git local, DIY |
|
127 |
git distributed, DIY |
|
Core Classes |
128 |
Choosing a “good”
hashCode() method |
|
129 |
String and good hashCode()
implementations. |
|
130 |
Common pitfall using trigonometric functions |
|
131 |
Using constants from java.lang.Math . |
|
132 |
Strings on CodingBat |
|
133 |
Masking strings |
|
134 |
Analyzing strings |
|
135 |
Pitfalls using “==”: Equality of
String instances |
|
136 |
Weird, weirder, weirdest! |
|
137 |
Analyzing file pathnames |
|
Arrays |
138 |
Assignment to final variable? |
|
139 |
Converting string arrays to HTML. |
|
140 |
Route navigation |
|
141 |
Examinations and mark frequencies |
|
142 |
Pangram checker |
|
143 |
Reconsidering System.out.format(). |
|
144 |
Understanding search results |
|
145 |
Implementing append directly |
|
146 |
Purge duplicates |
|
147 |
A container of fixed capacity holding integer values |
|
148 |
Allow for variable capacity holding integer values |
|
149 |
Reading console input |
|
150 |
Prettifying output representation |
|
151 |
2-dimensional arrays and .length |
|
152 |
External array and string exercises |
|
153 |
Tic-tac-toe using a two-dimensional array |
|
154 |
Changing the game's internal representation |
|
155 |
Tic-tac-toe, Computer
vs. human |
|
156 |
Adding support to retrieve statistical data. |
|
157 |
Testing an implementation |
|
158 |
Improving prime number calculation performance |
|
159 |
Calculating the median |
|
160 |
A simple character based plotting application |
|
Inheritance |
161 |
Let me pass, please! |
|
162 |
Why is == correctly comparing enum
instances? |
|
163 |
String vs.
StringBuffer |
|
164 |
Alternate implementation of opposite directions |
|
165 |
Defining a Shape class hierarchy |
|
166 |
Scaling shapes |
|
167 |
Providing toString()
methods |
|
168 |
protected vs. “package
private” |
|
169 |
protected access involving different
instances |
|
Error Handling |
170 |
Mind your prey |
|
171 |
Expected exception test failure |
|
Working with Numbers |
172 |
Auto boxing int to Double? |
|
173 |
Why using String userInput =
null ? |
|
174 |
Parsing short values |
|
175 |
Parsing short values in hexadecimal
representation |
|
176 |
Locale
definitions |
|
177 |
Formatting int , double and LocaleDate
|
|
178 |
Chaining subtract method calls |
|
interface definitions and abstract Classes |
179 |
Understanding Arrays.sort()
|
|
180 |
Sorting Rectangle instances by
width |
|
181 |
Sorting Rectangle instances by width and
height |
|
182 |
Adding flexibility in sorting rectangles |
|
183 |
A nonsense generator |
|
184 |
An interface based plotter |
|
Application deployment I |
185 |
Various integer array algorithms |
|
186 |
A command line version computing a sample's average and
median |
|
Reading character streams |
187 |
Adding line numbers to text files |
|
188 |
A partial implementation of GNU UNIX
wc |
|
Collections |
189 |
Inserting strings into a Set . |
|
190 |
Inserting strings into a List . |
|
191 |
Representing integer coordinate values |
|
192 |
Inserting Coordinate
instances into a Set . |
|
193 |
Getting a text's set of words. |
|
194 |
A text's set of words in alphabetic order |
|
195 |
Implementing unusual string sorting. |
|
196 |
Words and corresponding frequencies |
|
197 |
Formatting an address list |
|
198 |
Implementing a set of strings |
|
199 |
Implementing word frequencies by Map < String ,
Integer >
instances. |
|
200 |
Regain sorting capabilities. |
|
201 |
Creating an overview of grades showing frequencies |
|
202 |
Creating an overview of grades showing individual names |
|