Skip to content

Commit 2041f72

Browse files
committed
odds and ends
1 parent 8bd9f5b commit 2041f72

File tree

13 files changed

+18
-11
lines changed

13 files changed

+18
-11
lines changed

appd.tex

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -338,6 +338,7 @@ \subsection*{I added so many print statements I get inundated with output.}
338338

339339
\section{Logic errors}
340340

341+
341342
\subsection*{My program doesn't work.}
342343

343344
Logic errors are hard to find because the compiler and interpreter provide no information about what is wrong.

appe.tex

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -112,7 +112,7 @@ \section{Boolean methods}
112112
boolean bigFlag = !isSingleDigit(17);
113113
\end{code}
114114

115-
The first line displays \java{true} because 2 is a single-digit number.
115+
The first line displays {\tt true} because 2 is a single-digit number.
116116
The second line sets \java{bigFlag} to \java{true}, because 17 is {\em not} a single-digit number.
117117

118118
Conditional statements often invoke \java{boolean} methods and use the result as the condition:

ch01.tex

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,8 @@ \section{What is a computer?}
2424
Not surprisingly, searching for ``computer'' on \href{https://images.google.com/}{\tt images.google.com} displays rows and rows of these types of machines.
2525
However, in a more general sense, a computer can be any type of device that stores and processes data.
2626

27-
\href{http://www.dictionary.com/browse/computer}{\tt Dictionary.com} defines a computer as ``a programmable electronic device designed to accept data, perform prescribed mathematical and logical operations at high speed, and display the results of these operations. Mainframes, desktop and laptop computers, tablets, and smartphones are some of the different types of computers.''
27+
\href{http://www.dictionary.com/browse/computer}{\tt Dictionary.com} defines a computer as ``a programmable electronic device designed to accept data, perform prescribed mathematical and logical operations at high speed, and display the results of these operations.
28+
Mainframes, desktop and laptop computers, tablets, and smartphones are some of the different types of computers.''
2829

2930
\index{hardware}
3031
\index{processor}
@@ -360,6 +361,7 @@ \section{Formatting source code}
360361
Many editors will automatically format source code with consistent indenting and line breaks.
361362
For example, in DrJava (see Appendix~\ref{drjava}) you can indent your code by selecting all text ({\sf Ctrl+A}) and pressing the {\sf Tab} key.
362363

364+
363365
%\section{Style guidelines}
364366

365367
%\index{whitespace}

ch03.tex

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -227,6 +227,7 @@ \section{Literals and constants}
227227
For the benefit of others (and yourself in the future), it would be better to assign this value to a variable with a meaningful name.
228228
%We'll demonstrate in the next section.
229229

230+
230231
%\section{Literals and constants}
231232

232233
\index{literal}

ch04.tex

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -236,7 +236,7 @@ \section{Logical operators}
236236
Finally, the \java{!} operator inverts a boolean expression.
237237
So \java{!evenFlag} is true if \java{evenFlag} is false.
238238

239-
In order for an expression with \java{&&} to be true, both sides of the \java{&&} operator must be true.
239+
In order for an expression with \java{&&} to be true, both sides of the \java{&&} operator must be true.
240240
And in order for an expression with \java{||} to be false, both sides of the \java{||} operator must be false.
241241

242242
The \java{&&} operator can be used to simplify nested \java{if} statements.

ch05.tex

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -233,6 +233,7 @@ \section{Parameters and arguments}
233233
That variable belongs to \java{main}.
234234
Because variables only exist inside the methods where they are defined, they are often called {\bf local variables}.
235235

236+
236237
%\section{Multiple parameters}
237238

238239
\index{parameter!multiple}

ch07.tex

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,6 @@ \chapter{Arrays and references}
44
In this chapter, we'll learn how to store multiple values of the same type using a single variable.
55
This language feature will enable you to write programs that manipulate larger amounts of data.
66

7-
87
For example, Exercise~\ref{doubloon} asked you to check whether every letter in a string appears exactly twice.
98
One algorithm (which hopefully you already discovered) is to loop through the string 26 times, once for each lowercase letter:
109

@@ -289,6 +288,7 @@ \section{Copying arrays}
289288
\end{center}
290289
\end{figure}
291290

291+
292292
%\section{Array length}
293293

294294
\index{length!array}

ch08.tex

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -595,7 +595,7 @@ \section{CodingBat problems}
595595
}
596596
\end{code}
597597

598-
Next we look at the current number (based on the given index), and check if it's an 11.
598+
Next we look at the current number (based on the given index), and check if it's an 11.
599599
After that, we can recursively check the rest of the array.
600600
Similar to the noX problem, we only look at one integer per method call.
601601

ch09.tex

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -88,6 +88,7 @@ \section{Primitives vs objects}
8888
On the other hand, two \java{String} objects with the same characters would not be considered equal in the \java{==} sense.
8989
The \java{==} operator, when applied to string variables, only tests whether they refer to the {\em same} object.
9090

91+
9192
%\section{The null keyword}
9293

9394
\index{null}

ch10.tex

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -66,6 +66,7 @@ \section{Point objects}
6666
In this case, the value is a reference, which is represented with an arrow.
6767
The arrow points to the \java{Point} object, which contains two variables, \java{x} and \java{y}.
6868

69+
6970
%\section{Attributes}
7071

7172
\index{attribute}

0 commit comments

Comments
 (0)