Practicing and exploring
Test your knowledge and understanding by answering some questions, getting some hands-on practice, and exploring this chapter's topics with deeper research.
Exercise 3.1 – Test your knowledge
Answer the following questions:
- What happens when you divide an
int
variable by0
? - What happens when you divide a
double
variable by0
? - What happens when you overflow an
int
variable, that is, set it to a value beyond its range? - What is the difference between
x = y++;
andx = ++y;
? - What is the difference between
break
,continue
, andreturn
when used inside a loop statement? - What are the three parts of a
for
statement and which of them are required? - What is the difference between the
=
and==
operators? - Does the following statement compile?
for ( ; ; ) ;
- What does the underscore
_
represent in aswitch
expression? - What interface must...