Think Java: How to Think Like a Computer Scientist


Download 1.5 Mb.
Pdf ko'rish
bet8/8
Sana07.02.2023
Hajmi1.5 Mb.
#1175973
1   2   3   4   5   6   7   8
Bog'liq
True (1)


partial ordering, 170
pixel, 215, 218
poetry, 7
Point, 108


Index
247
portable, 2
precedence, 19, 238
primitive type, 115
print, 9, 13, 136
array of Cards, 173
Card, 167
print statement, 236, 240
printDeck, 173, 182
problem-solving, 11
procedural programming, 193
program development, 57, 83, 86,
155, 183
incremental, 142
planning, 142
programming
functional, 193
object-oriented, 193
procedural, 193
programming language, 1, 193
programming style, 193
prose, 7
prototype, 177
prototyping, 142
pseudocode, 183, 190
pseudorandom, 158
public, 9
pure function, 137, 141, 145
quote, 92
random number, 153, 183
range, 157
rank, 166
Rectangle, 110
recursion, 44, 47, 64, 175, 188
infinite, 177
recursive, 45
redundancy, 7
reference, 108, 112, 116, 168, 183, 185
relational operator, 40, 62
return, 43, 55, 111
inside loop, 174
return statement, 239
return type, 68
return value, 55, 68
rounding, 26
run-time error, 5, 93, 99, 114, 150,
172, 229
safe language, 5
sameCard, 169
scaffolding, 58, 68
searching, 173
selection sort, 184
semantics, 5, 11, 62
setColor, 214
shuffling, 183, 185
sorting, 184, 186
squiggly braces, 9
stack, 46, 66
stack diagram, 34
startup class, 145
state, 108, 116
state diagram, 108, 116, 149, 168,
172, 182
statement, 3, 11
assignment, 15, 75
comment, 9
conditional, 39
declaration, 15, 108
for, 152
import, 107, 223
initialization, 62
new, 108, 135, 182
print, 9, 13, 136, 236, 240
return, 43, 55, 111, 174, 239


248
Index
try, 223
while, 76
static, 9, 56, 133, 194, 197
String, 13, 98, 107
array of, 167
length, 92
reference to, 168
String method, 91
string operator, 20
subdeck, 177, 184
suit, 166
swapCards, 183
syntax, 4, 11, 230
syntax error, 4, 229
System object, 221
table, 78
two-dimensional, 80
temporary variable, 56, 238
testing, 177, 187
this, 134, 195, 197, 200
Time, 132
toLowerCase, 98
Torvalds, Linux, 6
toString, 195
toUpperCase, 98
traverse, 93, 100, 173
array, 155
counting, 96
try statement, 223
Turing, Alan, 64, 98
type, 22
array, 149
char, 91
conversion, 43
double, 25
int, 19
object, 115, 131
primitive, 115
String, 13, 107
user-defined, 131
typecast, 47
typecasting, 26, 43
user-defined type, 131
value, 15, 22
char, 92
value method, 36, 55
variable, 15, 22
instance, 109, 132, 181, 197
local, 83, 86
loop, 81, 84, 93, 150
temporary, 56, 238
void, 55, 68, 137
while statement, 76

Document Outline

  • Preface
  • The way of the program
    • What is a programming language?
    • What is a program?
    • What is debugging?
    • Formal and natural languages
    • The first program
    • Glossary
    • Exercises
  • Variables and types
    • More printing
    • Variables
    • Assignment
    • Printing variables
    • Keywords
    • Operators
    • Order of operations
    • Operators for Strings
    • Composition
    • Glossary
    • Exercises
  • Void methods
    • Floating-point
    • Converting from double to int
    • Math methods
    • Composition
    • Adding new methods
    • Classes and methods
    • Programs with multiple methods
    • Parameters and arguments
    • Stack diagrams
    • Methods with multiple parameters
    • Methods that return values
    • Glossary
    • Exercises
  • Conditionals and recursion
    • The modulus operator
    • Conditional execution
    • Alternative execution
    • Chained conditionals
    • Nested conditionals
    • The return statement
    • Type conversion
    • Recursion
    • Stack diagrams for recursive methods
    • Glossary
    • Exercises
  • GridWorld: Part 1
    • Getting started
    • BugRunner
    • Exercises
  • Value methods
    • Return values
    • Program development
    • Composition
    • Overloading
    • Boolean expressions
    • Logical operators
    • Boolean methods
    • More recursion
    • Leap of faith
    • One more example
    • Glossary
    • Exercises
  • Iteration and loops
    • Multiple assignment
    • The while statement
    • Tables
    • Two-dimensional tables
    • Encapsulation and generalization
    • Methods and encapsulation
    • Local variables
    • More generalization
    • Glossary
    • Exercises
  • Strings and things
    • Characters
    • Length
    • Traversal
    • Run-time errors
    • Reading documentation
    • The indexOf method
    • Looping and counting
    • Increment and decrement operators
    • Strings are immutable
    • Strings are incomparable
    • Glossary
    • Exercises
  • Mutable objects
    • Packages
    • Point objects
    • Instance variables
    • Objects as parameters
    • Rectangles
    • Objects as return types
    • Objects are mutable
    • Aliasing
    • null
    • Garbage collection
    • Objects and primitives
    • Glossary
    • Exercises
  • GridWorld: Part 2
    • Termites
    • Langton's Termite
    • Exercises
  • Create your own objects
    • Class definitions and object types
    • Time
    • Constructors
    • More constructors
    • Creating a new object
    • Printing objects
    • Operations on objects
    • Pure functions
    • Modifiers
    • Fill-in methods
    • Incremental development and planning
    • Generalization
    • Algorithms
    • Glossary
    • Exercises
  • Arrays
    • Accessing elements
    • Copying arrays
    • Arrays and objects
    • for loops
    • Array length
    • Random numbers
    • Array of random numbers
    • Counting
    • The histogram
    • A single-pass solution
    • Glossary
    • Exercises
  • Arrays of Objects
    • The Road Ahead
    • Card objects
    • The printCard method
    • The sameCard method
    • The compareCard method
    • Arrays of cards
    • The printDeck method
    • Searching
    • Decks and subdecks
    • Glossary
    • Exercises
  • Objects of Arrays
    • The Deck class
    • Shuffling
    • Sorting
    • Subdecks
    • Shuffling and dealing
    • Mergesort
    • Class variables
    • Glossary
    • Exercises
  • Object-oriented programming
    • Programming languages and styles
    • Object methods and class methods
    • The toString method
    • The equals method
    • Oddities and errors
    • Inheritance
    • The class hierarchy
    • Object-oriented design
    • Glossary
    • Exercises
  • GridWorld: Part 3
    • ArrayList
    • Interfaces
    • public and private
    • Game of Life
    • LifeRunner
    • LifeRock
    • Simultaneous updates
    • Initial conditions
    • Exercises
  • Graphics
    • Java 2D Graphics
    • Graphics methods
    • Coordinates
    • Color
    • Mickey Mouse
    • Glossary
    • Exercises
  • Input and Output in Java
    • System objects
    • Keyboard input
    • File input
    • Catching exceptions
  • Program development
    • Strategies
    • Failure modes
  • Debugging
    • Syntax errors
    • Run-time errors
    • Logic errors

Download 1.5 Mb.

Do'stlaringiz bilan baham:
1   2   3   4   5   6   7   8




Ma'lumotlar bazasi mualliflik huquqi bilan himoyalangan ©fayllar.org 2024
ma'muriyatiga murojaat qiling