Table of Contents
Data and Information, 1
Number Systems, Data Representation 2
Scratch Programming 22
Chapter 1
1.1 Introduction to Java 42
1.2 System Requirements for Java 43
1.3 Writing / Viewing Environment, Keyboard Shortcuts 43
1.4 Installation of the Java API files 44
1.5 Comments 48
1.6 Types and uses of Brackets 48
1.7 Unicode Values 49
1.8 Numbers and Equations 49
1.9 NETBEANS IDE 50
1.10 Changing the default JDK 50
1.11 Changing the size of the frame 54
1.12 Naming Components 54
1.13 Activities 55
1.14 Formatting Components 55
Chapter 2
2.1 Variables 57
2.2 Reserved Words 58
2.3 Data Types 58
2.4 Get and Set Methods 60
2.5 Activities
68
2.6 Type Casting 62
2.7 Activities 65
2.8 Navigating between frames 69
2.9 Add a Picture Background 73
2.10 Palette Components- Textfield, Textarea, Radio button etc 74
2.11 Beans Binding 83
2.12 Disabling Components 83
2.13 Date and Time 86
2.14 Setting a Password 85
2.15 Transfer of data between frames 88
2.16 Printing 88
2.17 Adding Sound 89
2.18 Adding Videos 88
2.19 Executable Files 89
2.20 Activities 91
i
Chapter 3
3.1 Assignment Statements 96
3.2 Activities 100
3.3 Arithmetic / Logical Operators 105
3.4 Scope of a variable 108
3.5 Types of Errors 108
3.6 Formatting data 108
3.6 Keyboard Input 111
3.7 Activities 113
3.8 Selection Structures (The if statement) 118
3.9 Example using Algorithms 120
3.10 Activity on ‘if’ statement 123
3.11 The Conditional Operator 126
3.12 The Switch Statement 127
3.13 Q & A on the Switch Statement 128
3.14 Exercise – Switch Statement 129
Chapter 4
4.1 Math Class, methods and Examples 131
4.2 Exercise – Math Class 134
4.3 String Class, Methods and Examples 135
4.4 SUMMARY OF STRING METHODS 141
4.5 Exercise – String Class 145
4.6 Advanced methods in the String class 147
Chapter 5
5.1 Looping Structures 153
5.2 For…loop 153
5.3 Q & A – for loop 157
5.4 Exercise – for loop 161
5.5 Conditional Looping: while loop 165
5.6 Conditional Looping: do… while 165
5.7 Rules for Algorithms + Exercises 169
5.8 Validation 170
5.9 Q & A – Conditional Loops 171
5.10 Exercise – Conditional Loops 173
Chapter 6
6.1 Character Class 178
6.2 Q & A- Character Class 178
6.3 Exercise – Character Class 180
ii
Chapter 7
7.1 Static / non Static Methods 181
7.2 Void / Typed Methods 182
7.3 Parameter Passing 188
7.4 Q & A 189
7.5 Method Overloading 191
7.6 Exercise – Methods 192
7.7 Classes, Objects, Accessors & Mutators – Introduction 193
Chapter 8
8.1 One Dimensional Arrays 194
8.2 Populating an Array 196
8.3 Displaying of Data 199
8.4 Examples 200
8.5 Sort Techniques + Code 205
8.6 Search Technique + Code 209
8.7 Exercise 211
8.9 Linked Arrays 218
Chapter 9
9.1 Exception Handling Techniques 224
9.2 Examples of checked / unchecked Exceptions 225
Chapter 10
10.1 Text Files 226
10.2 Importing Data + Q & A 227
10.3 Exporting Data + Q & A 230
10.4 Appending / Adding to Files 231
10.5 Examples 232
10.6 Exercise – Text Files 235
Chapter 11
11.1 Classes and Objects 240
11.2 Definitions 240
11.3 Examples with code 241
11.4 Creating Objects from Text Files 259
11.5 Activities 265
11.6 Array of Objects 266
11.7 Simple example + activity 271
11.8 Multiple object classes – Example + activity 273
11.9 Multiple object classes – Complex Example + activity 292
11.10 Inheritance 294
iii
11.11 Polymorphism 304
Chapter 12
12.1 Two Dimensional Arrays: Introduction 306
12.2 Populating 2D Arrays 307
12.3 Display 308
12.4 Q & A 309
12.5 Exercise 317
Chapter 13
13.1 Dynamic Components 322
13.2 Dynamic Arrays – Array List 324
Chapter 14
14.1 Concepts of Normalisation 325
14.2 Rules for Normalisation forms 326
14.3 Examples and Activities 328
14.4 A Data Dictionary 333
14.5 Input Mask 333
14.6 Validation Rules 333
14.7 DB CONNECTIVITY 335
14.8 Derby Database 336
14.9 Create a new Database 337
14.10 Import Data to a Derby Database (CSV files) 348
14.11 Direct Connection 350
14.12 Java Persistence API – Entity Manager 355
14.13 Displaying Data 360
14.14 Adding Records 361
14.15 Deleting Records 362
14.16 Editing Records 363
14.17 Activities 368
14.18 Foreign keys 378
14.19 Iterator and Navigation 382
Chapter 15
15.1 SQL’s 385
15.2 Activities 420
Appendix
A Unicode Chart 429
iv
B Bibliography 430
v
Reviews
There are no reviews yet.