Index

SYMBOLS

* (asterisk) wild card, 31

// (two forward slashes), 153

[ ] (braces), 337

_ (underscore character), 150

{ } (curly braces), 167

+ (concatenate) operator, 192, 193

++ (increment) operator, Java, 155

++x (prefix) operator, Java, 155

<applet> tag, 25

- (dash) character, 150, 155

. (period), 150

; (semicolon), 150152

A

Abstract Window Toolkit (AWT), 20, 279280

AbstractSequentialList, 272

acquire( ) method, threads, 234

acquireUninterruptibly( ) method, threads, 234

ACTION-SWITCH, COBOL

adding multiple message types with, 3839

implementing inheritance, 113118

Java objects in COBOL, 7376

method members vs., 87

private variables similar to, 14

returning value from private variables, 68

ActiveX specification, 322

add( ) method, ArrayLists, 267

addElement( ) method, Vectors, 267

AMOUNT element, OAG standard, 345

applet viewer (appletviewer.exe)

executing Java’s SDK, 21

running applets in, 2526

testing applets with, 35

<applet> tag, 25

applets

applications vs., 34

CODEBASE references, 28

creating with Java’s SDK, 2426

defined, 19

HelloWorld, 6263

portability problems of, 1920

summary of, 35

using AWT for GUI interaction, 279280

applications

applets vs., 34

HelloWorld, 6162

using AWT for GUI interaction, 279280

arithmetic operations, Java, 154159

exercises, 164165

floating-point operations, 154155

increment and decrement operators, 155

integer operations, 154155

list of, 156

object reference variables, 157159

postfix and prefix operators, 155

shortcut coding style, 155

arraycopy( ) function, 85

arraycopy( ) method, 85

ArrayIndexOutOfBoundsException exception, 84

ArrayList collection class

exercises, 275278

overview of, 266270

Vectors vs., 264

arrays

exercises, 9899

Java syntax, 173174

overview of, 8387

as parameters, 87

ASCII character set, 254

ASSIGN statement, 244

assignment function, Java vs. COBOL, 149

asterisk (*) wild card, import statement, 31

attributes, DTD, 335336

authoring, XML documents, 339

autoboxing, 199, 269

auto-commit, Connection class, 297

AUTOEXEC.BAT file, 22

AWT (Abstract Window Toolkit), 20, 279280

B

base classes. see also superclasses (parent classes)

bottom-up design, 102

hiding variables and methods, 126127

Java inheritance concepts, 121126

multiple inheritance and, 121

overview of, 102

using inheritance as design pattern, 109

Basic Multilingual Plane (BMP), 190

begin tag...end tag construct, XML, 332

BigDecimals, 202204, 214215, 217

BigIntegers, 202204, 214215, 217

BigNumbers, 202208, 214216, 217

binary arithmetic operators, Java, 154159

binarySearch( ) function, collections, 274

bitwise operations, Java, 156

black box, COBOL, 112

BMP (Basic Multilingual Plane), 190

boolean expressions, 169170

bottom-up design, inheritance, 102

braces ({ }), 167

brackets ([ ]), 337

break statement

defined, 181

exiting switch loop with, 177

flow control exercises, 184186

overview of, 177180

breakpoint, Eclipse debugger, 362363

browsers

supporting applets, 35

Web servers and, 308310

C

C comments, Java syntax, 152153

C++ comments, Java syntax, 152153

cab files, 33

CALL COUNTER, COBOL, 6668

CALL SUBROUTINE USING, COBOL, 49

callbacks, SAX parser, 340

CALLER COBOL

calling subroutine, 49

implementing inheritance, 114115

message passing, 37, 3940

method overloading, 4648

calling program

accessing public data members, 16

Caller class, 1213

calling subroutine, 49

causing runtime errors, 47

COBOL subroutines and, 4

containing its objects, 14

creating new object prior to using it, 71

error processing capabilities, 196, 219220, 225

inheritance in COBOL, 113, 119

method overloading in COBOL, 4445

and reference variables, 71, 73

cardinality rules, DTD elements, 334335

case sensitivity

identifiers, 151

Java compilers, 150

case statements

EVALUATE verb vs., 187

flow control exercise, 184

overview of, 176177

catalog content management, XML, 352

CICS, 314

class libraries, building GUIs with, 20, 279281, 286289

class members, 65100

arrays, 8387

classes, objects and members, 7172

constructors, 8991

data members, 7779

exercises, 9199

local variables, 7980

method members, 8789

MYSUB COBOL, 6668

objects and COBOL, 7276

overview of, 6566

primitive data types, 8083

reviewing samples, 99100

using objects in Java, 7677

variables, 6870

class methods, 87

class variables

defined, 77

exercises, 9698

overview of, 70

classes

from COBOL perspective, 9

data members, 7, 10

defined in Java, 7172

exercises in, 4957

grouping into packages. see packages

inheritance hierarchy, 102103

Java interfaces vs., 129

from Java perspective, 13, 15

CLASSPATH directory

adding jar file to, 33, 283

exercises, 55

overview of, 2728

client

accessing EJB from, 327

using online XML, 343

CLOSE file, 244

COBOL

collections vs. files in, 264265

error management, 220

Java BigDecimals vs., 204205

Java flow control operators vs., 181

Java I/O vs., 244245

Java operators vs., 153154

Java Strings vs., 189190, 194196

Java syntax vs., 149150

objects and, 109112

statements, 150

understanding reference variables, 154159

COBOL subroutines. see also MYSUB COBOL

behaving as object, 7276

calling, 49

Java class vs., 13, 15

objects vs., 5

overview of, 4

terms to review, 910

code block, 168172

CODEBASE references, 28

collections, 263278

AbstractSequentialList, 272

background, 264266

defining, 263

exercises, 275277

HashSet, 271

iterators, 272273

keyed, Hashtable and HashMap, 270271

LinkedList, 272

managing arguments and returning values for methods, 84

ordered, Vector and ArrayList, 266270

ordering and comparison functions, 273275

reviewing exercises, 277278

TreeSet, 272

commands, executable, 21

COMMAREA, CICS, 314

comments

flow control exercises, 182

Javadoc, 152153, 284286

Comparator interface, collections, 274275

compareTo( ) method, 216, 274275

comparison functions, collections, 273275

compile process, Java, 1819

compressed packages, 33

concatenate operator (+), 192, 193

ConcurrentHashMap collection class, 270

Connection class, 297298

constructors

BigDecimal and BigInteger, 203204

Hashtable and HashMap, 270271

from Java perspective, 14

overview of, 8991

Vectors and ArrayLists, 267

consumer (calling) class

extending methods, 107108

inheritance and, 122125

method overloading, 43

redefining methods, 106

sending messages to objects, 41

treating super-type objects, 109

using derived classes, 122

containers, EJB, 323325

continue statement

defined, 181

flow control exercise, 184

overview of, 177180

CONTROL-AREA, COBOL, 40, 47

copy( ) function, collections, 273

COPY statement, COBOL, 31

CounterServlet.java file, 317320

currentThread( ) method, 238239, 241

D

dash (-) character, 150, 155

data encapsulation, COBOL, 65

data members, Java, 14, 7779

data repositories, XML, 351

data types, primitive, 8083

databases. see JDBC (Java Database Connectivity)

DATETIME element, OAG standard, 345347

debugging, with Eclipse, 362363

DecimalFormat class, 197198, 261

declarations, XML, 337338

deletes, database, 300301

derived classes

clarifying variable for this operator, 127128

defined, 102

extending inherited methods, 106108

hiding methods and members, 131

hiding variables and methods, 126127

inheritance and, 103, 121126

inheriting methods, 103104

design patterns

COBOL object-oriented, 112119

inheritance and, 108109

Design Patterns: Elements of Reusable Object-Oriented Software (Gamma, Helm, Johnson, and Vlissides), 108109

directories

creating for applets, 24

creating for Java files, 22

File class functions, 248249

Java packages related to, 3233

distributed computing, EJBs, 322323

DNS (domain name system), 32, 308

Document Object Model (DOM) interface, 340

document type definitions. see DTDs (document type definitions), XML

doGet( ) method, HttpServlet, 312, 318

DOM (Document Object Model) interface, 340

domain name system (DNS), 32, 308

doskey command, 21

Double numeric class wrapper, 197198

doubleValue( ) method, 197198

do...while statement, 174175, 181

drawstring( ) method, Graphics class

adding to applet, 26, 5556, 59

overview of, 36

DriverManager, 296

drivers, JDBC

connecting to database, 296298

defined, 294

types of, 294295

DTDs (document type definitions), XML

attributes, 335336

complete documents, 338339

documents and, 332333

elements, 334

entities, 336337

OAG specifications for, 344351

E

Eclipse, 355367

debugging with, 362363

getting started with, 356358

installing, 356

making new project, 358361

overview of, 355

refactoring with, 363367

runtime, 362

EDI (Electronic Data Interchange), XML and, 342343

EJBs (Enterprise JavaBeans), 321328

accessing from client, 327

container services, 324325

distributed computing and, 322323

exercises, 327328

interfaces and implementation class, 325327

types of, 323324

Electronic Data Interchange (EDI), XML and, 342343

elements

adding to Hashtable and HashMap, 271

adding to Vectors or ArrayLists, 267268

DTD, 334335

XML nested, 332

encapsulation, 76

Enterprise Java

Eclipse. see Eclipse

Enterprise JavaBeans. see EJBs (Enterprise JavaBeans)

JDBC. see JDBC (Java Database Connectivity)

XML. see XML (Extensible Markup Language)

enterprise resource planning (ERP), 343

entities, DTD, 336337

EntityBeans, EJBs, 323324, 326327

equals( ) method, 191192, 216

ERP (enterprise resource planning), 343

Error class, 221

ErrorMsg class

arrays, 8387

constructors, 9091

defining methods in, 4041

exercises, 4961

exercises, class members, 9194, 9697, 99

exercises, polymorphism, 142143, 145

exercises, variables, 133138, 140, 144

Hashtable and HashMap, 271

HelloWorld applet, 6263

HelloWorld application, 6162

hiding variables and methods, 127

inheritance, 103108

inheritance and Java, 120126

iterators, 272273

Java data members, 7879

Java variables, 6971

method members, 8889

method overloading, 43, 4748

multiple messages, 4143

objects and Java, 1113

overview of, 6364

packages, 2932

refactoring in Eclipse, 366367

reviewing samples, 5761

the this variable, 127128

Vector and ArrayList, 267268

errors

exception handling. see exceptions

refactoring with Eclipse, 363367

EVALUATE verb, COBOL, 177, 181, 187

Exception class, 221222

exception processing, 196

exceptions, 219229

creating, 221223

Exception class hierarchy, 221

exercises, 237241

overview of, 219220

processing suggestions, 228229

using, 223227

EXCHANGE-AMOUNT, COBOL, 204205

executable code, 18

executeUpdate( ) method, 301

execution process, Java, 1819

exists( ) method, File class, 248

extends keyword, Java inheritance, 119121

Extensible Business Reporting Language (XBRL), 352

Extensible Markup Language. see XML

external entities, DTD, 336

F

factory class, 297

File class, 246249, 258261

FILE SECTION, DATA DIVISION, 244

FileInputStream class, 250

filenames

packages and, 3233

source, 2627, 33

FileReader class, 255

File.separator variable, 246

fill( ) function, collections, 273

Final keyword, 78

finalize( ) methods, garbage collection, 237

finally statement, 224226, 229

floating-point operations, Java, 154155

flow control, Java, 167187

break statement, 177180

code block, 168

continue statement, 177180

do...while statement, 174175

exercises, 181186

if statement, 168172

list of operators, 181

review, 186187

for statement, 175176

switch statement, 176177

while statement, 172174

for loop, collections, 273

for statement

defined, 181

flow control exercises, 183185

overview of, 175176

forName( ) method, 296

fully qualified names, 30

G

garbage collection, 236237

Generics, 266267

get( ) methods, File class, 247248

GET requests, 310, 312

“GET$NARGS” function, 4445

getConnection( ) method, database, 296, 302

getCounter( ) method, 100

getErrorMsg( ) method

adding to HelloWorld, 5254

synchronization, 234

using overloaded version of, 5658, 95

getFilePointer( ) method, RandomAccessFile, 257

getMessage( ) method, Exception class, 222

graphical user interfaces. see GUIs (Graphical user interfaces)

Graphics class, 36

GUIs (graphical user interfaces)

building with class libraries, 20

development of, 279281

exercise in creating, 286289

H

handle, reference pointer, 71

HashMap collection class

exercises, 275278

Hashtable vs., 264

overview of, 270271

HashSet, 271

Hashtable collection class, 264, 270271

HelloWorld applet

exercises in, 5356

overview of, 6263

review, 5960

HelloWorld application

ErrorMsg class in, 5758

overview of, 6162

HelloWorld program, 2224, 57

HelloWorld.html, 25

HelloWorld.java (example exercises)

applets, 24

BigNumbers, 214215

class members, 9293

flow control, 181186

I/O in Java, 258261

Java syntax, 160165

messages, 4957

numeric wrapper classes, 210213

string methods, 210

threads, 239240

hiding methods

and members, 131

and variables, 126127

home interface, EJB, 325326

home page, Eclipse, 357

hostname, 308

HTML (Hypertext Markup Language)

executing applets, 25

Web servers and, 308310

XML vs., 330332, 340341

HTTP (Hypertext Transfer Protocol)

compressed packages and, 33

Web servers using, 308310

HttpServlet, 312, 318

Hypertext Markup Language. see HTML

I

IDE (integrated development environment), 20, 355

identifiers, Java, 150152

if statement

defined, 181

flow control exercises, 181182

overview of, 168172

immutable strings, 192

implementation class, EJB, 325327

implements keyword, 129130

import statements, 3031

importing, Java files to Eclipse project, 358360

IMS, 314

increment operator (++), 155

indexed sequential (ISAM) file type, 270

information transfer systems, XML, 352

inheritance, 101126

clarifying variable for this operator, 127128

class definitions, 121122

COBOL object-oriented design patterns, 112119

COBOL perspective on, 109112

as design pattern, 108109

Exception class and, 221

exercises, 133144

extending class methods, 123124

extending methods, 106108

with extends keyword, 119121

hiding methods and members, 131

hiding variables and methods, 126127

inheriting methods, 103106

methods, 123126

object-oriented design and, 101102

objects and, 103

polymorphism and, 132

reviewing samples, 144145

sharing variables and methods, 126

string methods, 191192

from threads, 230232

using protected keyword, 122123

initialization

data variable, 6970

servlet, 312313

inner code blocks, 171172

inputfile property, properties file, 282

INPUT-OUTPUT SECTION, ENVIRONMENT DIVISION, 244

InputStream class, 249251, 259260

inserts, database, 300301

inside packages, 2931

installing, Eclipse, 356

integer operations, Java, 154155, 269

integrated development environment (IDE), 20, 355

intelligent agents, XML, 352

interfaces

from COBOL perspective, 9

EJB, 325327

Java, 128131

Java Collection framework, 265266

internal entities, DTD, 336

I/O in Java, 243262

exercises, 258262

File class, 246249

InputStream and OutputStream classes, 249251

overview of, 243

RandomAccessFile class, 256258

Reader and Writer classes, 254256

serialization, 252254

streams vs. record-based I/O, 244246

IOException class creating Exception objects with, 221

defined, 221

handling exceptions, 228

naming conventions, 221222

ISAM (indexed sequential) file type, 270

isDirectory( ) method, File class, 248

isFile( ) method, File class, 248

isolation level, EJBs, 324

iteration, 175176

iterators, 272273

J

jar files

compressed package technology, 33

containing servlet classes, 319

creating, 282284

Java. see also Enterprise Java

applets. see applets

BigNumbers. see BigNumbers

collections. see collections

data members, 7779

exceptions. see exceptions

flow control. see flow control, Java

GUI development, 279281

inheritance and, 119126

interfaces, 128131

I/O. see I/O in Java

numbers. see numbers

properties files, 281282

StringBuffers. see StringBuffers

strings. see strings

threads. see threads

utilities, 282286

variables, 6870

XML and, 339340

Java API For XML Processing (JAXP), 339341

Java Archive utility, 282284

Java byte codes, 18

Java compiler (javac.exe)

compiling applet, 2425

compiling Java source, 23

executing for SDK, 21

writing programs, 20

Java Database Connectivity. see JDBC (Java Database Connectivity)

Java Development Environment, 1736

applications vs. applets, 34

classes and filenames, 2628

CLASSPATH variable, 2728

CODEBASE references, 28

compressed packages, 33

getting started with SDK, 2124

inside packages, 2931

name collisions, 3132

packages, 2829

packages and filenames, 3233

review of code samples, 3436

runtime interpretation and Java byte codes, 1721

writing applet with SDK, 2426

java. exe (Java runtime), 21, 23

Java Foundation Classes (JFC), 20, 280281

Java Naming and Directory Interface (JNDI), 327

Java run unit, 16

Java runtime (java. exe), 21, 23

Java Server Pages. see JSPs

Java Studio, 21

Java syntax, 149165

binary arithmetic operators, 154159

COBOL vs., 149150

comments, 152153

exercises, 160165

flow control. see flow control, Java

operators, 153154

reference variables, understanding with COBOL, 159160

statements, 150152

Java virtual machines (JVMs), 1820

JAVA_HOME environment variable, 316

JavaBeans, 322

Javadoc

comments, 152153

utility, 284286

JAXP (Java API For XML Processing), 339341

JDBC (Java Database Connectivity), 293304

configuring JDBC-ODBC bridge, 301302

connecting to, 296298

exercises, 302304

how it works, 294295

inserting, updating and deleting, 300301

overview of, 293

querying tables, 298299

JDBC-ODBC bridge, 294295, 301304

JEE SDK, download and tutorial, 327328

JFC (Java Foundation Classes), 20, 280281

JFrame class, 280281

JNDI (Java Naming and Directory Interface), 327

JSPs (Java Server Pages), 314320

design principles for, 307

exercises, 317320

getting started with servlets and, 316317

overview of, 314316

JVM (Java virtual machine), 1820

K

keyed collections, 270271

L

LANGUAGECODE static variable, 133, 135136, 144

length numbers, arrays, 84

Level 88 items, COBOL, 336

LINKAGE SECTION, COBOL

data encapsulation and, 6566

describing subroutine parameters in, 4

implementing inheritance, 109112, 116119

terms to review, 910

LinkedList, 272

List interface, collections

AbstractSequentialList implementation, 272

defined, 265

LinkedList implementation, 272

local variables

exercises, 9698

overview of, 7980

review, 100

scope, 170172

logical operators, 169170

lookup() method, JDB, 327

M

Map interface, collections, 265, 270

markup tags, Javadoc comments, 285286

math functions, 202204, 207

MathContext parameter, Big Decimals, 203

max( ) function, collections, 274

member data items, 47

members

hiding methods and, 131

Java, 7172

memory

collections stored in, 265

shrinking Vectors or ArrayList to conserve, 269

message passing, 37

MessageBeans, EJBs, 324, 326327

messages, 3764

in COBOL, 3840

defined, 132

ErrorMsg class, 6364

exercises, 5761

exercises in classes, objects and methods, 4957

HelloWorld applet, 6263

HelloWorld application, 6162

in Java, 4041

method overloading in COBOL, 4448

multiple, 4143

overview of, 3738

terms, 48

method members, 8789

method overloading

in COBOL, 4448

exercise in, 5658

in Java, 4143, 48

review, 6061

method signatures, 48

methods

ArrayList, 270

array-specific, 8586

Connection class, 298

constructors vs., 8991

ErrorMsg class, 4041

extending inherited, 106108

File class, 246249

hiding members and, 131

hiding variables and, 126127

inheriting, 103104, 123126

InputStream class, 250

Java, 48

Java string, 191192, 194196

numeric wrapper classes, 196199

overriding, 123, 131

package, 70, 8789

private, 70

public, 70

redefining inherited, 105106

static, 70

StringBuffer, 200201

Vector, 270

MIME (Multipurpose Internet Media Extension) type, 309

min( ) function, collections, 274

MS-DOS window, 21

MsgThread.java file, 237238

MsgThreadRunnable.java file, 238239

multiple inheritance, 121, 128129

Multipurpose Internet Media Extension (MIME) type, 309

myErrorMsg class, 1213, 5860

MyFrame.java, 287289

MYSUB COBOL

implementing inheritance, 116119

message passing, 3740

method overloading, 4448

private variables, 6668

MYSUB subroutine, 59

MYSUB-CONTROL

all instances as objects in, 89

behaving as object, 7276

class data members in, 10

ErrorMsg class and, 11

inheritance, 110112, 113119

object-oriented language and, 7

N

name collisions, 3132

naming conventions

classes inside packages, 2931

Exception classes, 221222

internal and external classes, 35

name collisions, 3132

packages and files, 3233

public Java classes, 2627

source files, 2627

New Java Project dialog, Eclipse, 358359

NEWSUB COBOL, 109119

next() method, ResultSet, 299

NoDatabaseAvailableException, 223, 228

Number class, 197198

numbers

BigNumbers, 202208

exercises, 210217

numeric wrapper classes, 196199

placing into Vector arrays, 269

rounding options in Java and COBOL, 206

numeric wrapper classes, 196199, 210213, 217

O

OAG (Open Application Group), XML, 344351

object instance variables, 71, 7276

object reference variables, Java, 157160

object wrappers, 269

ObjectInputStream class, 253254

object-oriented language. see OO (object-oriented language)

ObjectOutputStream class, 253254

objects, 316

and COBOL, 510, 7276

defined, 7172

functionality of, 3

inheritance and, 103

Java and, 1216, 7677

message passing, 37

ODBC (Open Database Connectivity)

exercises, 302304

JDBC as variation on, 293294

JDBC-ODBC bridge, 294295, 301302

online references

authoring XML documents, 339

Eclipse, 20, 356

Java Software Development Kit, 20, 327

opening zip files, 356

predefined Exception objects, 221

Sun’s coding conventions, 151, 167

Tomcat, 316

URI type file specification, 247

online XML, 343344

OO (object-oriented language)

classes, objects and members, 7172

COBOL and, 510, 112119

inheritance and, 101102

from Java perspective, 3, 1314

message passing, 37

method overloading, 48

method signatures, 48

methods, 48

Open Application Group (OAG), XML, 344351

Open Database Connectivity. see ODBC (Open Database Connectivity)

OPEN file, 244

operator overloading, 193, 203

operators, Java

binary arithmetic, 154159

exercises, 163165

flow control, 181

syntax, 153154

options switches, 113

Order document type, 337

ordered collections, 266270

ordering functions, collections, 273275

outputfile property, properties file, 282

OutputStream class, 249251, 258260

overriding methods, 123, 131

P

Package Explorer, Eclipse

creating Java project, 359, 361

debugging with, 362

refactoring with, 363367

packages, 2833

compressed, 33

and filenames, 3233

inside, 2931

methods, 70, 8789

name collisions, 3132

overview of, 2829

variables, 68

paint( ) function, 35

parameter entities, DTD, 336337

parameters

arrays as, 87

calling subroutine, 49

passed, 47

parent classes. see superclasses (parent classes)

parentheses

controlling evaluation of expressions, 170

Java syntax, 153154, 162165

parse( ) method, DecimalFormat class, 197198

parseInt( ) method, 196197

passed parameters, Java, 47

pathname, Web servers, 309

PERFORM UNTIL, COBOL, 181, 187

performance, and Vectors, 267268

period (.), 150

PIC X, COBOL, 189, 216

polymorphism, 132133

PopupErrorMsg sample, 120, 122, 124125, 128

port number, 308, 317

POST requests, 310, 312

precedence conventions, operators, 153154

prefix operator (++x), 155

prepared statements, 300

prepareStatement( ) method, Connection, 300

primitive data types

autoboxing and unboxing, 199

Java Strings syntax vs., 190

overview of, 8083

PrintFileErrorMsg sample

creating and using, 136138

hiding variables and methods, 127, 138139

inheritance, 119120, 122, 124126

review, 144145

the this variable, 127128

using Java interfaces, 129130, 139141

printIn( ) method, 216

printIn statement

ErrorMsg class, 5758

exercises, class members, 9293

review, 100

PrintStream, 245

private elements or properties, COBOL, 10

private elements or properties, Java, 14

private methods, 70, 8789

private variables

COBOL, 6668

Java, 6870, 77, 94

properties, OO terminology, 7

properties files, Java, 281282

protected keyword, Java, 122123

protected variables, Java, 68, 77

public elements or properties, COBOL, 10

public elements or properties, Java, 14

public methods, 70, 8789

public variables

COBOL, 68

Java, 6870, 77, 94

put() method, Hashtable and HashMap, 271

Q

query strings, URL, 309310

querying tables, 298299

Queue interface, collections, 266

R

RandomAccessFile class, 256258

READ file, 244

READ NEXT statement, COBOL, 299

reading data

InputStream methods, 250

Reader class, 254256, 262

readLine( ) method, BufferedReader, 255

record-based I/O, 244246

refactoring, with Eclipse, 363367

reference variables

arrays as, 85

assignment and equality in, 157159

defined, 71

understanding with COBOL, 159160

release( ) method, threads, 234

Reload function, applet menu, 26

remote interface, coding EJB, 325

Remote Method Invocation (RMI), 252254

replaceAll( ) function, collections, 273

ResultSet objects, querying tables, 298299

reuse, Java support for, 77

reverse( ) function, collections, 273

RMI (Remote Method Invocation), 252254

rounding functions, BigDecimals, 205206

run( ) method

creating new thread, 230232

exercises, 238240

implementing Runnable interface, 232233

Runnable interface, 232233, 238240

runtime

Eclipse, 362

garbage collection at, 236237

Java byte codes at, 1721

optimizing strings at, 191

RuntimeException class, 221222, 228

S

s class. see derived classes

SAX (Simple API for XML) parsing interface, 340

Scanner class, 198, 216

schemas, XML, 339

scope, local variable, 170172

SDK (Software Development Kit)

creating applets with, 2426

development of, 20

getting started with, 2124

jar utility program, 282284

searches, XML-based, 352

security, EJB, 324

seek( ) method, RandomAccessFile, 257

SELECT statement, 244

semaphore tool, 234

semicolon (;), 150152

Serializable interface, 252254

serialization, 252254

servlet engine

overview of, 310

processing JSPs, 315

servlet protocol, 311314

servlets, 307320

browsers and Web servers, 308310

design principles for, 307

exercises, 317320

getting started with, 316317

Java Server Pages and, 314316

protocol, 311314

as transaction processor, 310

Session objects, creating, 313

SessionBeans, EJBs, 323, 326327

Set interface, collections

caution about, 272

defined, 265

HashSet implementation, 271

setErrorMsg method

inheritance, 120125

inheritance exercises, 134, 136138, 140145

message exercises, 5860

polymorphism, 132

setMsgText method, 133134, 144

setOut( ) method, PrintStream, 245

SGML (Standard Generalized Markup Language), 330

sharing, methods and variables, 126

signature, subroutine, 9

Simple API for XML (SAX) parsing interface, 340

SimpleFrame class, 287289

single-type-import declaration statement, 31

16-bit Unicode characters, Java Strings, 190

size, Vectors and ArrayLists, 267268

slashes (//), 153

sleep() method, threads, 239, 241

Software Development Kit. see SDK (Software Development Kit)

sort( ) function, collections, 273

SortedSet interface, collections

Comparator interface and, 275

defined, 265

TreeSet implementation of, 272

source filenames, 2627, 33

SQL

JDBC support for, 294

querying tables using, 298299

src directory, Eclipse, 360

standalone interpreters, 34

standard doclet, Javadoc, 286

Standard Generalized Markup Language (SGML), 330

standard in, 3536

standard out, 3536

start( ) method, 231, 233

stateful SessionBeans, EJBs, 323

stateless SessionBeans, EJBs, 323

statements, Java

COBOL vs., 150

in code blocks, 167

exercises, 161163

flow control. see flow control, Java

syntax, 150152

static class, 35, 70

static initializer code, 8889

static keyword, 131

static methods, 70

StAX (Streaming API for XML) interface, 340

stop processing variables, 231

stopThread( ) method, 231233, 238240

stream-based IO, 244246

Streaming API for XML(StAX) interface, 340

StringBuffers, 200201, 213214

strings, 202208

comparing, 191192

exercises, 210, 216

overview of, 189191

StringBuffers, 200201

working with, 193196

subclasses

defined, 102

Exception class hierarchy, 221

inheritance and, 3132, 103104

subroutines

calling, 49

COBOL, 4

reusing in complex environments, 112119

terminology, 910

Sun, integrated development environments, 2021

super keyword, 131

superclasses (parent classes)

hiding methods and members, 131

inheritance and, 103

inheritance as design pattern and, 109

inherited methods, 103104

inherited methods, extending, 106108

inherited methods, redefining, 105106

overview of, 102

swap( ) function, collections, 273

Swing class graphical libraries, 20, 280281

switch statement, 176177, 181

synchronization, 233234, 264

synchronized keyword, 233234

sysedit function, 22

System icon, Control Panel, 22

System.out.printIn( ) method

displaying information on console with, 244245

I/O exercises, 259260

Java compile and execution, 1819

overview of, 35

T

tables, querying database, 298299

tags, JSP, 316

templates, Java interfaces as, 129

text editors

creating HelloWorld.java, 24

getting started with SDK, 22

writing programs in Java with, 20

TextMessage class sample

creating, 133134

extending methods, 107

hiding methods and members, 131

hiding variables and methods, 127

inheritance, 119124, 126, 134136

inheriting methods, 103104

redefining methods, 105

review, 144145

sharing variables and methods, 126

TEXT-STRING, 39

this keyword, 90, 127128

Thread class, 230232

threads, 229241

benefits and cautions, 235236

exercises, 237241

garbage collection, 236237

implementing Runnable, 232233

inheriting from, 230232

overview of, 229230

synchronization, 233234

Throwable class, 221

timeToStop( ) method, threads, 231, 238240

Toggle Breakpoint option, Eclipse, 362

Tomcat Web server, 316317, 319

top-down implementation, inheritance, 102

toString( ) method, 193, 200

transaction contexts, EJBs, 324

transaction logic, updating database, 297

transaction processors, servlets as, 310

TreeSet, 272

try...catch code blocks, 223226, 228229

type cast, 8283

type-import-on-demand declaration statement, 31

Types 1 - 4 JDBC drivers, 294295

U

UML (Universal Modeling Language), static classes, 128

unboxing, 199

underscore character (_), 150

Unicode format

comparing Java strings, 194

double-byte, 254

Java strings, 82, 189190

XML document characters similar to, 337

Universal Modeling Language (UML), static classes, 128

updates, database, 300301

URI type file specification, 247

URL (Uniform Resource Locator)

CODEBASEs defined by, 28

overview of, 308309

UTF-8 coding scheme, XML declarations, 337

utilities, Java, 282286

V

value-added networks (VANs), EDI services, 342

VANs (value-added networks), EDI services, 342

variables

clarifying for this operator, 127128

defined, 71

exercises, 131145

hiding, 126127

Java, 6870

reference, 154159

sharing methods and, 126

stop processing, 231

Vector collection class, 264, 266270

virtual machine environment, 18

W

Web servers

browsers and, 308310

servlet engines operating as, 310

servlet protocol, 311314

Tomcat, 316317

Web services, XML, 343344

while statement

defined, 181

do...while statement vs., 174

overview of, 172174

for statement vs., 176

Windows 98, Me, XP, Vista, 2000 and 2003, 22

WordPad, 22

WORKING-STORAGE area, COBOL

class variables vs., 70

data encapsulation and, 6566

DTD comparable to, 334

implementing inheritance, 116119

private items in, 10

Workspace Launcher, Eclipse, 357

write( ) method, OutputStream, 251

WRITE file, 244

writing data

OutputStream methods, 250251

Writer class, 254256, 262

X

x++ (postfix) operator, Java, 155

XBRL (Extensible Business Reporting Language), 352

XHTML, 340341

XML (Extensible Markup Language), 329354

authoring XML documents, 339

basics of, 330

complete XML documents, 338

declaration, 337338

document type definitions, 332333

DTD components, 333337

Electronic Data Interchange, 342343

exercises, 352354

HTML vs., 330332, 340341

Java and, 339340

OAG specifications for, 344351

possible new application functions, 351352

schemas, 339

Web services or online, 343344

where to use, 341342

XML documents

authoring, 339

complete, 338

defined, 330

XMLDocAnalyzer.java, 352354

XSD (XML Schema Definition), 339

Z

zip files

compressed packages, 33

jar files vs., 282

unpacking, 356

..................Content has been hidden....................

You can't read the all page of ebook, please click here login for view all page.
Reset