dummies
 
 

Suchen und Finden

Titel

Autor/Verlag

Inhaltsverzeichnis

Nur ebooks mit Firmenlizenz anzeigen:

 

Beginning Programming with Java For Dummies

Beginning Programming with Java For Dummies

von: Barry A. Burd

For Dummies, 2017

ISBN: 9781119235545 , 552 Seiten

5. Auflage

Format: PDF

Kopierschutz: DRM

Mac OSX,Windows PC Apple iPad, Android Tablet PC's

Preis: 20,99 EUR

Exemplaranzahl:  Preisstaffel

Für Firmen: Nutzung über Internet und Intranet (ab 2 Exemplaren) freigegeben

Derzeit können über den Shop maximal 500 Exemplare bestellt werden. Benötigen Sie mehr Exemplare, nehmen Sie bitte Kontakt mit uns auf.


Mehr zum Inhalt

Beginning Programming with Java For Dummies


 

Title Page

5

Copyright Page

6

Table of Contents

9

Introduction

17

About This Book

17

How to Use This Book

18

Conventions Used in This Book

18

What You Don’t Have to Read

19

Foolish Assumptions

20

How This Book Is Organized

20

Part 1: Getting Started with Java Programming

21

Part 2: Writing Your Own Java Programs

21

Part 3: Controlling the Flow

21

Part 4: Using Program Units

21

Part 5: The Part of Tens

22

Icons Used in This Book

22

Beyond the Book

23

Where to Go from Here

23

Part 1 Getting Started with Java Programming

25

Chapter 1 Getting Started

27

What’s It All About?

27

Telling a computer what to do

28

Pick your poison

29

From Your Mind to the Computer’s Processor

30

Translating your code

30

Running code

31

Code you can use

36

Your Java Programming Toolset

37

A tool for creating code

38

What’s already on your hard drive?

38

Chapter 2 Setting Up Your Computer

39

If You Don’t Like Reading Instructions . . .

40

Getting This Book’s Sample Programs

42

Setting Up Java

43

Downloading and installing Java

45

If you want to find Java on your computer . . .

50

Setting Up the Eclipse Integrated Development Environment

56

Downloading Eclipse

57

Installing Eclipse

59

Running Eclipse for the first time

60

Importing This Book’s Sample Programs

66

What’s Next?

69

Chapter 3 Running Programs

71

Running a Canned Java Program

71

Typing and Running Your Own Code

76

Separating your programs from mine

77

Writing and running your program

78

What’s All That Stuff in Eclipse’s Window?

87

Understanding the big picture

87

Views, editors, and other stuff

88

What’s inside a view or an editor?

90

Returning to the big picture

92

Part 2 Writing Your Own Java Programs

95

Chapter 4 Exploring the Parts of a Program

97

Checking Out Java Code for the First Time

97

Behold! A program!

98

What the program’s lines say

99

The Elements in a Java Program

100

Keywords

101

Identifiers that you or I can define

103

Identifiers with agreed-upon meanings

104

Literals

105

Punctuation

106

Comments

107

Understanding a Simple Java Program

109

What is a method?

109

The main method in a program

112

How you finally tell the computer to do something

113

The Java class

115

Chapter 5 Composing a Program

119

Computers Are Stupid

120

A Program to Echo Keyboard Input

121

Typing and running a program

122

How the EchoLine program works

125

Getting numbers, words, and other things

126

Type three lines of code and don’t look back

128

Expecting the Unexpected

130

Diagnosing a problem

131

What problem? I don’t see a problem

141

Chapter 6 Using the Building Blocks: Variables, Values, and Types

145

Using Variables

146

Using a variable

147

Understanding assignment statements

148

To wrap or not to wrap?

148

What Do All Those Zeros and Ones Mean?

150

Types and declarations

151

What’s the point?

152

Reading Decimal Numbers from the Keyboard

153

Though these be methods, yet there is madness in ’t

154

Methods and assignments

154

Variations on a Theme

156

Moving variables from place to place

156

Combining variable declarations

158

Experimenting with JShell

159

Launching the JShell program

160

Using JShell

161

Chapter 7 Numbers and Types

167

Using Whole Numbers

167

Reading whole numbers from the keyboard

169

What you read is what you get

170

Creating New Values by Applying Operators

172

Finding a remainder

172

The increment and decrement operators

179

Assignment operators

185

Size Matters

187

Chapter 8 Numbers? Who Needs Numbers?

191

Characters

192

I digress . . .

193

One character only, please

195

Variables and recycling

195

When not to reuse a variable

197

Reading characters

199

The boolean Type

203

Expressions and conditions

204

Comparing numbers; comparing characters

205

The Remaining Primitive Types

212

Part 3 Controlling the Flow

215

Chapter 9 Forks in the Road

217

Decisions, Decisions!

218

Making Decisions (Java if Statements)

219

Looking carefully at if statements

220

A complete program

223

Indenting if statements in your code

227

Variations on the Theme

228

. . . Or else what?

228

Packing more stuff into an if statement

230

Some handy import declarations

232

Chapter 10 Which Way Did He Go?

237

Forming Bigger and Better Conditions

237

Combining conditions: An example

240

When to initialize?

242

More and more conditions

243

Using boolean variables

245

Mixing different logical operators together

247

Using parentheses

249

Building a Nest

250

Nested if statements

252

Cascading if statements

253

Enumerating the Possibilities

256

Creating an enum type

257

Using an enum type

257

Chapter 11 How to Flick a Virtual Switch

263

Meet the switch Statement

263

The cases in a switch statement

266

The default in a switch statement

267

Picky details about the switch statement

268

To break or not to break

271

Using Fall-Through to Your Advantage

273

Using a Conditional Operator

278

Chapter 12 Around and Around It Goes

281

Repeating Instructions over and over Again (Java while Statements)

282

Following the action in a loop

284

No early bailout

286

Thinking about Loops (What Statements Go Where)

287

Finding some pieces

288

Assembling the pieces

290

Getting values for variables

291

From infinity to affinity

292

Thinking about Loops (Priming)

294

Working on the problem

297

Fixing the problem

300

Chapter 13 Piles of Files: Dealing with Information Overload

303

Running a Disk-Oriented Program

304

A sample program

306

Creating code that messes with your hard drive

308

Running the sample program

312

Troubleshooting problems with disk files

314

Writing a Disk-Oriented Program

317

Reading from a file

318

Writing to a file

319

Writing, Rewriting, and Rerewriting

322

Chapter 14 Creating Loops within Loops

325

Paying Your Old Code a Little Visit

326

Reworking some existing code

327

Running your code

328

Creating Useful Code

328

Checking for the end of a file

329

How it feels to be a computer

331

Why the computer accidentally pushes past the end of the file

333

Solving the problem

334

Chapter 15 The Old Runaround

341

Repeating Statements a Certain Number of Times (?Java for Statements)

342

The anatomy of a for statement

344

Initializing a for loop

345

Using Nested for Loops

348

Repeating Until You Get What You Need (Java do Statements)

354

Getting a trustworthy response

355

Deleting a file

356

Using Java’s do statement

358

A closer look at the do statement

359

Repeating with Predetermined Values (Java’s Enhanced for Statement)

361

Creating an enhanced for loop

361

Nesting the enhanced for loops

363

Chapter 16 Using Loops and Arrays

369

Some Loops in Action

369

Deciding on a loop’s limit at runtime

371

Using all kinds of conditions in a for loop

374

Reader, Meet Arrays; Arrays, Meet the Reader

376

Storing values in an array

380

Creating a report

381

Initializing an array

383

Working with Arrays

384

Looping in Style

388

Deleting Several Files

389

Part 4 Using Program Units

397

Chapter 17 Programming with Objects and Classes

399

Creating a Class

400

Reference types and Java classes

401

Using a newly defined class

402

Running code that straddles two separate files

403

Why bother?

405

From Classes Come Objects

405

Understanding (or ignoring) the subtleties

408

Making reference to an object’s parts

408

Creating several objects

409

Another Way to Think about Classes

412

Classes, objects, and tables

412

Some questions and answers

413

What’s Next?

414

Chapter 18 Using Methods and Fields from a Java Class

417

The String Class

418

A simple example

418

Putting String variables to good use

419

Reading and writing strings

421

Using an Object’s Methods

422

Comparing strings

425

The truth about classes and methods

426

Calling an object’s methods

428

Combining and using data

428

Static Methods

429

Calling static and non-static methods

431

Turning strings into numbers

431

Turning numbers into strings

433

How the NumberFormat works

435

Your country; your currency

435

Understanding the Big Picture

437

Packages and import declarations

437

Shedding light on the static darkness

439

Barry makes good on an age-old promise

440

Chapter 19 Creating New Java Methods

447

Defining a Method within a Class

447

Making a method

448

Examining the method’s header

449

Examining the method’s body

450

Calling the method

451

The flow of control

452

Using punctuation

453

The versatile plus sign

454

Let the Objects Do the Work

457

Passing Values to Methods

458

Handing off a value

461

Working with a method header

462

How the method uses the object’s values

463

Passing more than one parameter

464

Getting a Value from a Method

466

An example

466

How return types and return values work

468

Working with the method header (again)

470

Chapter 20 Oooey GUI Was a Worm

473

The Java Swing Classes

474

Showing an image on the screen

475

Just another class

478

The Swing Classes: Round 2

483

Extending a class

484

Code Soup: Mixing XML with Java

486

Using JavaFX and Scene Builder

489

Installing Scene Builder

489

Installing e(fx)clipse

490

Creating a bare-bones JavaFX project

491

Running your bare-bones JavaFX project

492

Adding Stuff to Your JavaFX Project

493

Taking Action

498

Part 5 The Part of Tens

505

Chapter 21 Ten Websites for Java

507

This Book’s Website

507

The Horse’s Mouth

507

Finding News, Reviews, and Sample Code

508

Looking for Java Jobs

508

Got a Question?

508

Chapter 22 Ten Useful Classes in the Java API

509

ArrayList

509

File

510

Integer

510

JFrame

510

JOptionPane

511

Math

512

NumberFormat

512

Scanner

513

String

513

System

513

Index

515

EULA

555