A


absolute paths, 771–772

abstract

class declaration, 16–18

class member declaration, 41–45

exercise creating abstract superclass, 18–19

interface declaration, 20

access control

class access, 13

default access, 13–14

levels of, 12

local variables, not using with access modifiers, 38–39

modifiers, 24–26

public access, 14–15

self test answers, 77–80

self test questions, 75–76

access modifiers, 24–26

addition (+) operator, 286

advanced overloading

overloading combined with var-args, 243–244

overloading combined with widening and boxing, 242–243

overloading with boxing and var-args, 239–240

overloading with widening reference variables, 240–241

overview, 237–239

two-minute drill, 258

AND (&), 296–297

AND (&&) operator (short-circuit), 294–296

anonymous arrays, 218–220

anonymous inner classes, 647–654

argument-defined, 652–654

flavor one, 647–651

flavor two, 651–652

two-minute drill, 658

append(), StringBuffer method, 426

"appropriate" vs. "legal," 380

arg_index, format strings, 490

argument-defined, anonymous inner classes, 652–654

arguments

constructor, 132

not using assertions to validate arguments to public methods, 380–381

not using assertions to validate command-line arguments, 381

variable arguments. See var-args (variable arguments)

arithmetic operators

increment/decrement, 290–291

overview, 286

remainder (%), 287

string concatenation, 287–289

two-minute drill, 299

ArrayList

in collections List interface, 542

overview, 547–548

sorting, 549

arrays

anonymous, 218–220

array elements in loops, 215–216

ArrayList compared with, 547

asList(), 559

constructing, 210–213, 256

converting to/from lists, 559

declaring, 55–57, 209–210, 256

enhanced for loops, 338–340

initializing, 214–218, 256

instance variables, 196–197

as instanceof objects, 285

legal elements in assignments, 220

length attribute, 423

local, 200

methods, 568

multidimensional, 223–224

of object references, 221

one-dimensional, 222–223

of primitives, 220–221

searching, 557–758

serialization and, 456

sorting, 548–551

two-minute drill, 73

unassigned and uninitialized, 193, 256

Arrays.sort(), 556

asList(), 559

assert, 375–377

AssertionError, 373

assertions

appropriate use of, 380–382

command-line switches, 378–379

compiling assertion-aware code, 376–377

disabling, 378–379

enabling, 375, 377–379

expression rules, 373–374

identifier vs. keywords and, 375–376

overview, 371–373

running with, 377

self test answers, 399–410

self test questions, 389–398

two-minute drill, 388

assignment (=) operators

boxing and, 235–236

compound assignment operators, 277–278

floating-point numbers, 186

literals that are too large for the variable, 186–187

overview of, 180–181, 276–277

primitive assignments, 181–183

primitive casting, 183–185

assignments

advanced overloading. See overloading, advanced

anonymous arrays, 218–220

array construction, 210–213

array declaration, 209–210

array elements in loops, 215–216

array initialization, 214–215

array initialization shortcut, 216–218

array instance variables, 196–197

arrays, legal elements in, 220

arrays of object references, 221

arrays of primitives, 220–221

assignment operators. See assignment ( = ) operators

autoboxing, 234

boxing, 235–237

floating-point numbers, 186

garbage collection. See garbage collection

initialization blocks, 224–227

literals for primitive types, 176–180

literals that are too large for the variable, 186–187

local arrays, 200

local object references, 199–200

local primitives, 197–199

multidimensional arrays, 223–224

object reference variables, 203–204

one-dimensional arrays, 222–223

pass-by-value and, 204–205

passing variables into methods, 203

primitive assignments, 181–183

primitive casting, 183–185

primitive variable assigned to another primitive variable, 188

primitive variables, 194, 205–206

reference variables, 188–190, 194–196, 200–203

scope and,190–193

self test answers, 266–274

self test questions, 259–265

stack and heap and, 174–175

two-minute drill, 255–258

unassigned, uninitialized variables or arrays, 193

valueOf() methods, 230

wrapper classes and boxing and, 227–228

wrapper constructors, 229

wrapper conversion utilities, 230–233

autoboxing

assignments and, 234

collections and, 548

overloading and, 238




SCJP Sun Certified Programmer for Java 5 Study Guide Exam 310-055
SCJP Sun Certified Programmer for Java 5 Study Guide (Exam 310-055) (Certification Press)
ISBN: 0072253606
EAN: 2147483647
Year: 2006
Pages: 131

flylib.com © 2008-2017.
If you may any questions please contact us: flylib@qtcs.net