19.09.2015 Views

Prentice.Hall.Introduction.to.Java.Programming,.Brief.Version.9th.(2014).[sharethefiles.com]

Create successful ePaper yourself

Turn your PDF publications into a flip-book with our unique Google optimized e-Paper software.

Index 807<br />

Scroll panes<br />

DescriptionPanel.java, 646<br />

overview of, 644<br />

scrolling lists, 651<br />

Searches<br />

arrays, 245<br />

binary searches, 246–248, 748–749<br />

linear searches, 245–246<br />

recursive approach <strong>to</strong> searching for words, 738<br />

Security restrictions, applets, 675–676<br />

Selection sorts<br />

arrays, 245, 249–250<br />

RecursiveSelectionSort.java, 747–748<br />

using recursion, 747<br />

Selection statements, 82, 84<br />

Selections<br />

Addition.Quiz.java example, 83–84<br />

boolean data type, 82–84<br />

case study: <strong>com</strong>puting Body Mass Index, 97–99<br />

case study: <strong>com</strong>puting taxes, 99–101<br />

case study: determining leap year, 105–106<br />

case study: guessing birthdays, 86–89<br />

case study: lottery, 106–108<br />

<strong>com</strong>mon errors, 93–95<br />

conditional expressions, 111–112<br />

confirmation dialogs, 117–119<br />

debugging, 119–120<br />

formatting console output, 112–115<br />

generating random numbers, 96–97<br />

if statements, 84–86<br />

if-else statements, 89–91<br />

key terms, 120<br />

logical opera<strong>to</strong>rs, 101–105<br />

nested if statements and multi-way if-else statements,<br />

91–93<br />

opera<strong>to</strong>r precedence and associativity, 115–117<br />

overview of, 81–82<br />

questions and exercises, 121–131<br />

summary and exercises, 120–121<br />

switch statements, 108–111<br />

Semicolons (;), <strong>com</strong>mon errors, 93<br />

Sentinel-controlled loops, 141–143, 164–165<br />

Sequential files, input/output streams, 729<br />

Serialization<br />

of arrays, 728–729<br />

of objects, 727<br />

setBackground method, Component class, 499<br />

setFont method, Component class, 499<br />

setForeground method, Component class, 499<br />

setLayout method, Component class, 451<br />

setLength method, StringBuilder class, 355–356<br />

setRadius method<br />

CircleWithPrivateDataFields.java example, 321<br />

SimpleCircle example, 299<br />

Setter (muta<strong>to</strong>r) methods<br />

ArrayList class and, 434<br />

encapsulation of data fields and, 320–322<br />

Shallow copies, clone method and, 579–580<br />

Sharing code, 182<br />

short numeric type, 45<br />

Short-circuited OR opera<strong>to</strong>r, 104<br />

showConfirmDialog method, JOptionPane class,<br />

117–119<br />

showInputDialog method, JOptionPane class, 70, 72<br />

showMessageDialog method, 22–23<br />

Shuffling arrays, 228–229, 268<br />

Sierpinski triangle<br />

case study, 754–755<br />

<strong>com</strong>puting recursively, 762, 766–767<br />

SierpinskiTriangle.java, 755–757<br />

Signed applets, 676<br />

sin method, trigonometry, 197–198<br />

Sine function, 511<br />

Single precision numbers. see Floating-point numbers/float<br />

data type<br />

Single-dimensional arrays. see Arrays, single-dimensional<br />

Sinking sorts, 258<br />

Sliders<br />

overview of, 657–658<br />

SliderDemo.java, 658–660<br />

Software<br />

development process, 58–62<br />

programs as, 2<br />

sort method<br />

Arrays class, 252<br />

ComparableRectangle.java example,<br />

575–576<br />

SortRectangles.java example, 576–577<br />

using recursion, 747–748<br />

Sorting arrays<br />

bubble sorts, 258<br />

insertion sorts, 250–252<br />

overview of, 248<br />

selection sorts, 245, 249–250<br />

Source objects, event sources and, 602–603<br />

Source program or source code, 10, 40<br />

Spacing, programming style and, 25<br />

Special characters, 18<br />

Specific import, 24<br />

Splash screens, 467<br />

split method, strings, 341, 342<br />

StackOfIntegers class, 386–387<br />

StackOverflowError, recursion causing, 757<br />

Stacks<br />

case study: cus<strong>to</strong>m stack class, 436–437<br />

case study: designing class for stacks, 386–388<br />

start method, applet life-cycle methods, 677–678<br />

State, of objects, 296<br />

Statements<br />

executing one at a time, 119<br />

executing repeatedly (loops), 134<br />

in high-level languages, 10<br />

termina<strong>to</strong>rs, 17<br />

Static data, in GuessDate class, 388, 390

Hooray! Your file is uploaded and ready to be published.

Saved successfully!

Ooh no, something went wrong!