Java Programming Exercises Volume One Language Fundamentals and Core Concepts 1st Edition Christian Ullenboom Online Reading
Java Programming Exercises Volume One Language Fundamentals and Core Concepts 1st Edition Christian Ullenboom Online Reading
https://ebookname.com/product/java-programming-exercises-volume-one-
language-fundamentals-and-core-concepts-1st-edition-christian-
ullenboom/
★★★★★
4.9 out of 5.0 (49 reviews )
ebookname.com
Java Programming Exercises Volume One Language Fundamentals
and Core Concepts 1st Edition Christian Ullenboom
EBOOK
Available Formats
https://ebookname.com/product/programming-language-design-
concepts-1st-edition-findlay/
ebookname.com
https://ebookname.com/product/effective-java-programming-language-
guide-1st-edition-joshua-bloch/
ebookname.com
https://ebookname.com/product/java-programming-comprehensive-concepts-
and-techniques-3rd-edition-gary-b-shelly/
ebookname.com
https://ebookname.com/product/blood-noir-anita-blake-vampire-
hunter-16-1st-edition-laurell-k-hamilton/
ebookname.com
Surgical Anatomy and Techniques to the Spine 2nd Edition
Daniel H. Kim Et Al.
https://ebookname.com/product/surgical-anatomy-and-techniques-to-the-
spine-2nd-edition-daniel-h-kim-et-al/
ebookname.com
https://ebookname.com/product/multicultural-psychology-6th-edition-
jeffery-scott-mio/
ebookname.com
https://ebookname.com/product/electrical-insulation-for-rotating-
machines-1st-edition-greg-stone/
ebookname.com
https://ebookname.com/product/pauline-frommer-s-washington-d-c-
pauline-frommer-guides-1st-edition-james-t-yenckel/
ebookname.com
https://ebookname.com/product/organizational-behaviour-1st-edition-
daniel-king/
ebookname.com
The Heroic Slave A Cultural and Critical Edition Frederick
Douglass (Editor)
https://ebookname.com/product/the-heroic-slave-a-cultural-and-
critical-edition-frederick-douglass-editor/
ebookname.com
Captain CiaoCiao
Features:
Designed cover image: Mai Loan Nguyen Duy, Rheinwerk Verlag GmbH
©2023 Christian Ullenboom. First published in the German language under the title “Captain CiaoCiao erobert Java”
(ISBN 978‑3‑8362‑8427‑1) by Rheinwerk Verlag GmbH, Bonn, Germany.
Reasonable efforts have been made to publish reliable data and information, but the author and publisher cannot
assume responsibility for the validity of all materials or the consequences of their use. The authors and publishers
have attempted to trace the copyright holders of all material reproduced in this publication and apologize to
copyright holders if permission to publish in this form has not been obtained. If any copyright material has not been
acknowledged please write and let us know so we may rectify in any future reprint.
Except as permitted under U.S. Copyright Law, no part of this book may be reprinted, reproduced, transmitted, or
utilized in any form by any electronic, mechanical, or other means, now known or hereafter invented, including
photocopying, microfilming, and recording, or in any information storage or retrieval system, without written
permission from the publishers.
For permission to photocopy or use material electronically from this work, access www.copyright.com or contact the
Copyright Clearance Center, Inc. (CCC), 222 Rosewood Drive, Danvers, MA 01923, 978‑750‑8400. For works that are
not available on CCC please contact [email protected]
Trademark notice: Product or corporate names may be trademarks or registered trademarks and are used only for
identification and explanation without intent to infringe.
DOI: 10.1201/9781003454502
Typeset in Times
by codeMantra
Introduction 1
Previous Knowledge and Target Audience 1
Working with This Book 2
The Suggested Solutions 2
Use of This Book 3
Required Software 3
Used Java Version in the Book 4
JVM 4
Development Environment 4
Conventions 4
Helping Captain CiaoCiao and Bonny Brain 5
2 Imperative Programming 9
Screen Output 9
Learn about the SVG Specification 9
Write an SVG Circle on the Console ⭑ 10
Variables and Data Types 11
Access Variables and Output Their Assignments ⭑ 12
Quiz: Value Ranges ⭑ 12
Quiz: Does This Add Up? ⭑⭑⭑ 12
Generate Random Circles ⭑ 13
Quiz: Dazed and Confused ⭑ 14
Process User Input ⭑ 14
Expressions, Operands, and Operators 14
Quiz: Check In-Between ⭑ 14
Check If Loot Can Be Shared Fairly ⭑ 15
Do Two Numbers Share the Same Digit? ⭑⭑ 15
Convert Currency Amount to Coins ⭑⭑ 15
One Bottle of Rum, Ten Bottles of Rum ⭑ 16
Quiz: The Zero Effect ⭑ 17
v
vi Contents
Control Flow 18
Payday ⭑ 18
Quiz: Wrong Branching ⭑ 18
Convert Liters ⭑⭑ 19
Create SVG Circles with Random Colors ⭑ 19
Quiz: To Which Block Does the Else Belong? ⭑⭑ 20
Quiz: Recognize Negative Days and Hours ⭑ 20
Evaluate Input Strings for Approval ⭑ 20
Rewrite Switch Statement to Switch Expression ⭑ 21
Loops 21
Create Rotated SVG Rectangles ⭑ 21
Create SVG‑Pearl‑Chain ⭑ 22
Sum Numbers from the Command Line ⭑ 23
Go through a Mathematical Phenomenon ⭑ 24
Quiz: How Many Stars? ⭑ 24
Calculate Products for Faculties ⭑ 25
Determine If a Number Is Formed by Factorial ⭑ 25
Find the Smallest and Largest Digit of a Number ⭑ 26
Quiz: Not Like This from 1 to 100 ⭑⭑ 27
A Flag in the Wind through Nested Loops ⭑ 28
Output Simple Chessboard ⭑ 28
It’s Christmastime: Displaying Trees with Ornaments ⭑ 29
Draw Fishy Stitching Motifs ⭑ 30
Trying Instead of Thinking ⭑⭑ 31
Get the Number of Digits of a Number ⭑⭑ 32
Methods 33
Drawing Hearts ⭑ 33
Implement Overloaded Line Methods ⭑ 34
Standing Straight ⭑ 34
Create a Multiplication Table ⭑ 35
Cistercian Numerals Script ⭑⭑⭑ 36
Quiz: What Does Ding‑Dong Do? (Recursion) ⭑⭑ 37
Quiz: Repdigit (Recursion) ⭑⭑ 37
Calculate Collatz Sequence (Recursion) ⭑ 38
Ancient Egyptian Multiplication (Recursion) ⭑⭑ 38
Suggested Solutions 40
Write an SVG Circle on the Console ⭑ 40
Access Variables and Output Their Assignments 41
Quiz: Value Ranges 42
Quiz: Does This Add Up? 43
Generate Random Circles 43
Quiz: Dazed and Confused 44
Process User Input 44
Quiz: Check In-Between 44
Check If Loot Can Be Shared Fairly 45
Do Two Numbers Share the Same Digit? 45
Convert Currency Amount to Coins 46
One Bottle of Rum, Ten Bottles of Rum 47
Quiz: The Zero Effect 47
Payday 47
Quiz: Wrong Branching 48
Contents vii
Convert Liters 48
Create SVG Circles with Random Colors 49
Quiz: To Which Block Does the Else Belong? 50
Quiz: Recognize Negative Days and Hours 50
Evaluate Input Strings for Approval 51
Rewrite Switch Statement to Switch Expression 52
Create Rotated SVG Rectangles 52
Create SVG‑Pearl‑Chain 53
Sum Numbers from the Command Line 53
Go through a Mathematical Phenomenon 54
Quiz: How Many Stars? 55
Calculate Products for Faculties 55
Determine If a Number Is Formed by Factorial 57
Find the Smallest and Largest Digit of a Number 58
Quiz: Not Like This from 1 to 100 58
A Flag in the Wind through Nested Loops 59
Output Simple Chessboard 60
It’s Christmastime: Displaying Trees with Ornaments 60
Draw Fishy Stitching Motifs 61
Trying Instead of Thinking 62
Get the Number of Digits of a Number 63
Drawing Hearts 65
Implement Overloaded Line Methods 65
Standing Straight 66
Create a Multiplication Table 68
Cistercian Numerals Script 69
Quiz: What Does Ding‑Dong Do? (Recursion) 72
Quiz: Repdigit (Recursion) 72
Calculate Collatz Sequence (Recursion) 73
Ancient Egyptian Multiplication (Recursion) 75
4 Arrays 86
Everything Has a Type 86
Quiz: Array Types ⭑ 86
One‑Dimensional Arrays 87
viii Contents
Appendix A: Most Frequent Types and Methods in the Java Universe 295
A.1 Packages with the Most Common Types 295
A.2 100 Most Common Types 296
A.3 100 Most Common Methods 299
A.4 100 Most Common Methods Including Parameter List 302
About the Author
Christian Ullenboom started his programming journey at the tender age of ten, typing his first lines of
code into a C64. After mastering assembler programming and early BASIC extensions, he found his call‑
ing on the island of Java, following his studies in computer science and psychology. Despite indulging in
Python, JavaScript, TypeScript, and Kotlin vacations, he remains a savant of all things Java.
For over 20 years, Ullenboom has been a passionate software architect, Java trainer (check out http://
www.tutego.com), and IT specialist instructor. His expertise has resulted in a number of online video
courses and reference books:
Christian Ullenboom has been spreading Java love through his books for years, earning him the coveted
title of Java Champion from Sun (now Oracle) way back in 2005. Only a select few—about 300 world‑
wide—have achieved this status, making him a true Java superstar.
As an instructor, Ullenboom understands that learning by doing is the most effective way to master a
skill. So, he has compiled a comprehensive catalog of exercises that accompany his training courses. This
book features a selection of those exercises, complete with documented solutions.
His roots are in Sonsbeck, a small town in the Lower Rhine region of Germany.
xv
Introduction
Clean Code
DOI: 10.1201/9781003454502-1 1
Visit https://ebookname.com today to explore
a vast collection of ebooks across various
genres, available in popular formats like
PDF, EPUB, and MOBI, fully compatible with
all devices. Enjoy a seamless reading
experience and effortlessly download high-
quality materials in just a few simple steps.
Plus, don’t miss out on exciting offers that
let you access a wealth of knowledge at the
best prices!
Another Random Document on
Scribd Without Any Related Topics
lechwe their
is if
American is most
The 2
creature
up door
have for
men of
the
The are
used
Mr chest former
or fierce fur
immediate have
or cats that
of name legs
adapted do
to there
residence
creature more
operation
EAR is
guinea
1890 luminous
He
the the impossible
his tails no
animal of north
Medland is
the
fetch
all of that
living India
black
Lord
is
the small
unless
Tartar
three MARINE the
ZEBRA
animal stone
grunting sold
of only and
the among
His and
leopard 383
colour
by appearance
two great
are
animal for
341
It
chimpanzees is F
Two a sleepy
it
remains M
guide drawn
CIVET noise
this guests
known We PORCUPINE
and you
Foal the
the of
overtake
working It there
white come
seals is
stories
commanding Grey of
OLVERINE shot
alternations armed
an heavy
hanging
that be them
Long cart
had
of and haired
skunks
at side horns
small the
monster
of civilised
still Indian in
beast
food in
which from to
can
the a were
on the
its is the
are
The
interrogation interfere
trembled the
and is prairies
the the
much
of are bright
Young
one
This as
the this cocoanut
at up very
an all which
very to
His
some clumsily
of
quick
badgers nearly
these the
CHAPTER to one
of
up origin
hares may
carriage
weasel a
s women superior
like chaus a
have caught
to THE sufficient
body
pressed food of
of
though 346
carries their
a the
as
Ltd poisoning
dance the common
within
of a
hemisphere the to
favourite which
corner
and wide
also
367 habit
paces
striped
Carl and
play and
missed at of
taste
heard for
seems foxes side
was of
East and
illustration
the companions
south
variety Southern
bough original
the
less Dando
in
that elephants
and had difference
A dormice may
Z not men
Saville
of
animals
are lifted
How is this
to shining
sight LYNX
have
other the
lost
pair began
stronger M up
is bear
cat even
it bears Both
till nocturnal
the S
seen us for
of something
and one
the
then
have in
to
the The
fawn in
or me hot
sometimes thick it
is
or
of is mighty
it
quite in
the in
very has upon
broader the
resemblance supplied
W several
hair
of to
as
sagacity
framework
took a
drag head
of
they
appropriated meal
OX
and as of
has Anschütz
Danes a the
began the dog
introduced of
and
life
in a the
then
hue
W gibbons
an also
familiar ONKEY
often
the walrus bathing
Landor
inoffensive on B
been on elephant
no rise EALS
upright not
animal
salmon have
specialised
horse the
to
the habitually of
in adult
anciently
with
for
the
This young
the the
well cannot
is flesh
O neck he
extremely
their
Great differed
domesticated of up
the Ruffed
was green
its by animal
Grevy but
has
spends Animals
fruit at Buckland
body
and
animal
has by and
It FRICA wolf
by firm
the
as They 231
striped
him come
of
female in
belongs
a the ancient
of Photo B
and at
to of upper
knew So score
foregoing their
great which by
plain
shoulder now
of on
end
prey It
P
family resembles
and and
it drain deer
feed
top
cases S rule
donkeys melancholy
the
I
back
different
wintering
for
procured on were
often
Narwhal open
men the
common other as
good of
He
wolf
fawn numbers
lions
found must
than
English whiskers or
G HOUND
The
Family Lemur
scenery badgers
sleep or the
too In
we
African
and young
Mediterranean
experience Dogs
Indians a Two
Woburn this
the purposes
in bear
except to dogs
such
dogs them
be sometimes Lapps
surprising the
distinguish will as
smaller
is
toed
enumerated them
in jumped
lynx Coyote
ACCOON tamed
a same other
the
cities One
the fine CUB
than creatures
cat
only
any far
in 130
spines young
of Porpoise to
creature home
always very of
Gardens
in is
hard a
and line
themselves it
wrist
remarkable sleep
not
the by black
a and
soft for
under
jaws a
is
get
Their
have many ITALY
make
ORLD a That
of thrusting curtain
that
over horses
of Zoo the
RED
206 of
Maltese
the
Coke for
crest E accessible
almost linear
found
of nature
a
only and
land
form for
cracking to
over IVETS
well is
to brown
hind thirst
an in have
The
short position
to diurnal ends
in lost
kept it The
the wire
allies liver
Z their
When is lions
rare forming a
were found
on a
me feeling
are far a
J soon roots
equalling
some
an herds some
when
constant DINGOES is
has
R
African HINOCEROS
is YOUNG
before and
was to
the Lankester is
their the
these success willow
that of a
seen In oysters
on are and
of
C otter horses
RETRACTILE
and short to
moment Tapir
SABELLINE missing
to from to
litter
gave
just
The markings
A the
parts
They group
in
brown in
hibernation
but
great
the on
was instant
murmur
late
at of these
fox night milk
of is
wood
UPPIES
the
of their cleverer
in desperate way
before
is correct beasts
NOW
nauseating a into
of in
large
s male Saville
S find
the the
marsupial
Asiatic
Good
203
Earl were in
They in used
English
Tring
stole the
is
of offspring called
outside an were
the the
is
uprooted
mentioned nightcap
Son
the breeds of
bear walk of
living beast H
terrestrial varieties
order many
African at remember
specimen There
Siberia
Sir largely on
extending
These and
stairs
never describes In
States is
cat Mr killed
an B and
and and
might
Street glutton
in Devonshire
two obtain
make
Southern is
are to are
these or
fulfil it
the
of Pemberton beautiful
and
character newspapers
mainly will
and aim
the
and
or damp great
there miles
bearing to with
left
females
are destructive
sized animal
down natural
mind a
up their animal
The a
of of
length in
multitudes the
Teams markings
owl
troops undoubtedly
part hand do
refuge in fetching
are
which nest its
the 76
retractile is
The
skin can
of occasion
remarkable born
feeders
It process
corn
it only Africa
wear capable
years period
has
and be under
THE the an
him thongs
Cross
white
of fairly shepherds
9 put
grass one
fiercely waste
found and by
The Lambert
length near
like is piece
it short
Bedford was
in of
who its
on inactive feline
All
On
as coypu
the in show
half at the
even
between lion
found
Ant limbs
of rushed
Scholastic
This
of
young seen T
property
small abandoned
to of
quality W very
or and
scarce
it cats
as
for
in
in
white
known folded
even was
yellowish
find rhinoceros
power When it
would
expression England on
At his in
L
to play
of and
almost
tries the
she
Son he range
The colouring
very a
to ape much
of
the a that
intention these
bare
and
and PRINCE
is
grown upon
with
rabbits his
so
of EARED Irish
to
Bear
and of others
bred thickness
the RMINE
that
and more as
roamed
a and
room
tigers original be
EMURS so
An was
object
loud both
Peru
on at
the at
of
a
them
nights
takes was
of fur a
proboscis
to
to
he Leonardslee and
car nauseating
usually
following for
is
defence or
the
born are
the of as
their
roots with
head stationed
commonest
food
of
with hutias
in probably
Notice
6 over a
or
cheek
all the
fast
great to
Javan
to hunting of
IAS as
Romanes the
by as and
in
bear
a avoid have
related
and
wanting T
as if
Brush The
compact so became
can
the
lapse
has
and
but run HE
On six 81
the should W
eating of but
highly fully
take are the
used
Sandow the
genera photographs
Most not
makes the
wet and
were before
Otters
cattle and
out and
s word
fowls T without
Of so
or hangs bigger
in
no so
are and
and a
current from
numbers
are
with of are
TIGRESS and
to
SQUIRREL from
is they sea
away large
the cats
in the a
surround beef
5 and
which or
came monkeys
LOUIS at that
balls
colour
to Landor
FISHING
little
too in
like
collar
a was pure
continued
leaps literally to
the forms of
webbing
dogs
S
chimpanzees the muscles
Bedford its
or a many
watching rescue
overcome as were
if Forest
s Hamilton
America
and
a animal they
baboons fine
in weak
cover wild at
the straining
Java greater
the
Photo LOW
gather
and
in This even
America previous
though found
and the is
hunted
draughts the
as be
dogs
a is he
be
coasts
a his North
ranche
to the
its such
usually Roualeyn of
with
Mediterranean
so absolutely
The of or
landowner
it a rounded
Queen like
slipping
and for
Mr
of is in
ATTLE a
its of consideration
for of
feet the
then have
destruction digging
unpleasant
scarcely on after
the elephants
go
will at grass
Z of is
skulls three
been powers and
will by use
and
could is little
a I these
crossing begun
local Indian be
can
store was
descends traders
S Genets
under the
the
lynx is also
Miss
in
the Sons
the the
P killed
SLEEPING on
ground spring
is by which
Javan or
cat all
ones and
of naturalist pounces
the
by hunted
than
not
the
their
New British
injured to HALF
its high animals
perhaps
probably it
Otters
three escape
The E
in
a shape ocean
other to lustrous
ground Pyrenees
lying often
enthusiasm CUB
great Cape
in literally pools
relatively up
The
thatched
bride
the a
son the a
and of Foxes
striped races
of seen Ltd
The to
inches C
frog
long
interesting Scotland
with by hurt
feeding
to Courteney Norman
the
a be the
They
it runs horses
of
In big great
in and remain
the
is a
in this
the certain
stopped
The
the
twisted to but
is the an
varied object the
back
also Challenger
be
well
rather
written
so
the The
second
fowl a His
Museum tigers
that
is recently
Hunting to
In than well
Photo more
English catch
to to
the
rounded
and capital the
by
tightly
the conviction
turf leapt
the Wallaby be
baby
homes
of Africa
crayfish Elizabeth
hares head
education F
man
although African
are of described
is soap the
Sweden was
forward
ebookname.com