Preface | p. vii |
Object Oriented Programming | p. 1 |
Introduction to OOP | p. 1 |
Objects and Classes | p. 2 |
Characteristics of OOP | p. 4 |
Encapsulation | p. 5 |
Inheritance | p. 6 |
Polymorphism | p. 8 |
Difference between OOP and Procedure Oriented Programming | p. 11 |
Summary | p. 11 |
Benefits of OOP | p. 11 |
Drawbacks of OOP | p. 12 |
Challenges of OOP | p. 12 |
Objective type questions | p. 12 |
Exercises | p. 13 |
Answers | p. 14 |
Introduction to Java Programming | p. 15 |
Introduction | p. 15 |
Overview of Java technology | p. 15 |
A short history of the development of Java | p. 18 |
Java as a new paradigm in programming | p. 19 |
Features of Java | p. 19 |
Comparing Java and Other Languages | p. 22 |
Applications and Applets | p. 23 |
Simple applications using Java | p. 23 |
Other applications and applets | p. 24 |
Java Development Kit | p. 28 |
More Complex Programs | p. 29 |
Java Source File Structure | p. 30 |
Prerequisites for Compiling and Running Java Programs | p. 31 |
Objective type questions | p. 32 |
Exercises | p. 32 |
Answers | p. 32 |
Java Language Fundamentals | p. 33 |
The Building Blocks of Java | p. 33 |
Lexical tokens | p. 33 |
Literals | p. 34 |
White spaces | p. 37 |
Comments | p. 38 |
Data Types | p. 39 |
Integral data types | p. 39 |
Floating-point numbers | p. 40 |
Boolean data types | p. 40 |
Variable Declarations | p. 41 |
Declaring, initializing and using variables | p. 41 |
Variable types in Java | p. 41 |
Object reference variables | p. 43 |
Default values for member variables | p. 44 |
Initializing local variables of different data types | p. 45 |
Initializing local reference variables | p. 46 |
Wrapper Classes | p. 47 |
Operators and Assignment | p. 48 |
Operators | p. 48 |
Assignment | p. 49 |
Mathematical operators | p. 51 |
Relational operators | p. 53 |
Logical operators | p. 55 |
Bitwise operators | p. 56 |
Shift operators | p. 56 |
Ternary If-Else operator | p. 57 |
Comma operator+ | p. 58 |
String operator+ | p. 58 |
Operator precedence | p. 58 |
Casting operators | p. 59 |
Control Structures | p. 60 |
Block | p. 60 |
Loop | p. 61 |
Branching statements | p. 68 |
Arrays | p. 74 |
One-dimensional arrays | p. 74 |
Multi-dimensional arrays | p. 75 |
Strings | p. 77 |
Constructors of String class with character array and string object | p. 77 |
Constructors of String class with byte array | p. 78 |
Methods of the String class | p. 79 |
The StringBuffer Class | p. 82 |
Constructors of the StringBuffer class | p. 82 |
Objective type questions | p. 83 |
Exercises | p. 87 |
Answers | p. 88 |
Java as an OOP Language | p. 89 |
Defining Classes | p. 89 |
Creating instance and class variables | p. 89 |
Defining methods | p. 90 |
Knowing this | p. 92 |
Variable scope and method definitions | p. 94 |
Passing arguments to methods | p. 96 |
Class methods | p. 98 |
Overloading methods | p. 99 |
Constructor methods | p. 100 |
Inheritance, polymorphism and abstract classes | p. 104 |
Overriding methods | p. 108 |
Finalizer methods | p. 112 |
Modifiers | p. 113 |
Controlling access to methods and variables | p. 114 |
Method protection and inheritance | p. 117 |
Creating accessor methods | p. 117 |
Class variables and methods | p. 119 |
Finalizing classes, methods and variables | p. 122 |
Abstract classes and methods | p. 123 |
Packages | p. 126 |
Using packages | p. 127 |
Using package and class names in full | p. 127 |
The import command | p. 128 |
Name conflicts | p. 128 |
Creating packages | p. 129 |
Packages and class protection | p. 131 |
Interfaces | p. 133 |
Interfaces and classes | p. 133 |
Creating and extending interfaces | p. 133 |
Other uses of interfaces | p. 139 |
Objective type questions | p. 139 |
Exercises | p. 147 |
Answers | p. 147 |
Exception Handling | p. 148 |
Introduction | p. 148 |
Basics of Exception Handling in Java | p. 150 |
Exception Hierarchy | p. 152 |
Throwable class hierarchy | p. 152 |
Constructors and Methods in Throwable Class | p. 153 |
Constructors | p. 153 |
Methods | p. 154 |
Unchecked and Checked Exceptions | p. 155 |
Handling Exceptions in Java | p. 155 |
Try block | p. 156 |
Catch block | p. 156 |
Finally block | p. 158 |
Multiple catch blocks | p. 159 |
Nested try statements | p. 161 |
The keyword throw | p. 162 |
Exception and Inheritance | p. 163 |
Throwing User-defined Exceptions | p. 165 |
Redirecting and Rethrowing Exceptions | p. 167 |
Redirecting exceptions using throws | p. 167 |
Rethrowing an exception | p. 170 |
Advantages of the Exception-Handling Mechanism | p. 171 |
Objective type questions | p. 176 |
Exercises | p. 179 |
Answers | p. 180 |
Multithreading | p. 181 |
Introduction: an Overview of Threads | p. 181 |
Creating Threads | p. 182 |
Creating a new thread extending Thread | p. 182 |
Creating a thread implementing Runnable interface | p. 185 |
Stopping threads: the join() method | p. 187 |
Naming a thread | p. 188 |
Thread Life-cycle | p. 188 |
The newborn state | p. 188 |
The runnable state | p. 188 |
The running state | p. 189 |
The dead state | p. 190 |
The blocked state | p. 190 |
Manipulating threads | p. 190 |
Thread Priorities and Thread Scheduling | p. 192 |
setPriority and getPriority | p. 192 |
Time-slicing | p. 192 |
The scheduler | p. 192 |
Thread Synchronization | p. 193 |
Synchronized methods | p. 194 |
Synchronized statements | p. 196 |
Deadlocks | p. 198 |
Daemon Threads | p. 198 |
Thread Groups | p. 199 |
Communication of Threads | p. 201 |
Sample Programs | p. 206 |
Objective type questions | p. 210 |
Exercises | p. 212 |
Answers | p. 212 |
Files and I/O Streams | p. 213 |
An overview of I/O Streams | p. 213 |
Java I/O | p. 214 |
Character streams | p. 214 |
Byte streams | p. 216 |
Working with the I/O super-classes | p. 217 |
File Streams | p. 220 |
FileInputStream and FileOutputStreara | p. 222 |
Filter Streams | p. 224 |
DataInputStream and DataOutputStream | p. 225 |
PushbackInputStream | p. 227 |
RandomAccessFile | p. 228 |
Serialization | p. 230 |
Objective type questions | p. 233 |
Exercises | p. 235 |
Answers | p. 236 |
Applets | p. 237 |
Introduction | p. 237 |
JavaApplications Versus Java Applets | p. 239 |
Applet Life-cycle | p. 239 |
The init() method | p. 241 |
The start() method | p. 241 |
The stop() method | p. 242 |
The destroy() method | p. 242 |
The paint() method | p. 242 |
Working with Applets | p. 243 |
Running the applet using AppletViewer | p. 245 |
Running the applet using the web browser | p. 246 |
The HTML APPLET Tag | p. 248 |
Attributes in the applet tag | p. 248 |
Passing parameters to applets | p. 249 |
The java.Applet package | p. 251 |
Sample Programs | p. 253 |
Objective type questions | p. 259 |
Exercises | p. 261 |
Answers | p. 261 |
Database Handling using JDBC | p. 262 |
An Overview of DBMS | p. 262 |
Database operations | p. 263 |
Database application architectures | p. 263 |
JDBC Architecture | p. 266 |
Interfaces in JDBC API | p. 266 |
Types of database driver | p. 267 |
Working with JDBC | p. 267 |
Accessing a database using JDBC | p. 267 |
Registering the driver | p. 268 |
Connecting to the database | p. 268 |
Processing Queries | p. 270 |
The Statement class | p. 271 |
Accessing rows returned from a query | p. 273 |
Accessing column data | p. 273 |
The method PreparedStatement | p. 277 |
The method CallableStatement | p. 278 |
The Transactions Commit and Rollback | p. 279 |
Handling Exceptions | p. 280 |
Mapping Database Types to Java | p. 281 |
Java format types | p. 281 |
Accessing Metadata | p. 282 |
Methods in the class ResultSetMetadata | p. 282 |
The class DatabaseMetadata | p. 283 |
Sample Programs to Handle Databases | p. 284 |
Objective type questions | p. 294 |
Exercises | p. 296 |
Answers | p. 297 |
The Abstract Window Toolkit | p. 298 |
Introduction | p. 298 |
Basic Classes in AWT | p. 299 |
The class Graphics | p. 299 |
Colours | p. 299 |
Font | p. 300 |
Drawing with Graphics Class | p. 300 |
Class Hierarchy of AWT | p. 301 |
Event Handling | p. 302 |
Adapter classes | p. 304 |
AWT Controls | p. 305 |
Labels | p. 305 |
Buttons | p. 305 |
CheckBox | p. 307 |
CheckboxGroup for creating Radio Buttons | p. 308 |
Choice control | p. 310 |
List control | p. 311 |
TextField control | p. 313 |
Scrollbars | p. 314 |
Layout Managers | p. 315 |
The FlowLayout manager | p. 316 |
The GridLayout manager | p. 316 |
The BorderLayout manager | p. 317 |
The CardLayout manager | p. 318 |
The Java2D API | p. 319 |
Java2D Shapes | p. 319 |
Texture paint and gradient paint: | p. 323 |
Objective type questions | p. 327 |
Exercises | p. 329 |
Answers | p. 329 |
Swings | p. 330 |
Introduction | p. 330 |
The Swing Packages | p. 331 |
The Hierarchy of Swing Classes | p. 332 |
JPopupMenu | p. 332 |
JDesktopPane and JInternalFrame | p. 336 |
Advanced Layout Managers | p. 340 |
The BoxLayout manager | p. 342 |
The GridBagLayout manager | p. 343 |
Additional Swing Components | p. 348 |
The Jlist class | p. 348 |
The JcomboBox class | p. 351 |
Constructing menus | p. 354 |
The JTextArea class | p. 359 |
The JTable control | p. 365 |
Customizing the frame and its look-and-feel | p. 366 |
The JToolBar class | p. 372 |
The JSlider control | p. 375 |
The JProgressBar class | p. 378 |
Borders | p. 382 |
Objective type questions | p. 385 |
Exercises | p. 387 |
Answers | p. 387 |
Servlets | p. 388 |
Introduction | p. 388 |
Advantages of servlets | p. 389 |
Writing servlets | p. 389 |
How to Run Servlets | p. 391 |
Running HtmlToServlet | p. 392 |
The Life-cycle of the Servlet | p. 393 |
Instantiating and initializing a servlet-the init() method | p. 394 |
Handling client requests and responses-the service() method | p. 395 |
Destroying the Servlet-the destroy() method | p. 395 |
Servlet API | p. 396 |
Interfaces | p. 397 |
Classes | p. 397 |
The GenericServlet class | p. 397 |
The HttpServlet class | p. 398 |
Multi-tier Applications using JDBC from a Servlet | p. 404 |
Writing JDBC/Servlet | p. 404 |
A sample JDBC/Servlet application | p. 406 |
Additional Capabilities of HTTP Servlets | p. 408 |
Objects of the HttpServletRequest class | p. 409 |
Objects of the HttpServletResponse class | p. 409 |
Examples of GET and POST Requests | p. 410 |
Session Management | p. 412 |
Sample Programs | p. 414 |
Objective type questions | p. 421 |
Exercises | p. 423 |
Answers | p. 424 |
Networking and Remote Method Invocation | p. 425 |
Introduction to Networking | p. 425 |
Understanding Ports | p. 426 |
Networking Classes in the JDK | p. 427 |
Basics of sockets | p. 427 |
Simple client-server programming | p. 428 |
Reading from and writing to a socket | p. 429 |
Introduction to RMI | p. 432 |
RMI Architecture | p. 433 |
Proxy layer or stub/skeleton layer | p. 435 |
Remote reference layer | p. 435 |
Transport layer | p. 435 |
Implementing Remote Class and Interface | p. 435 |
Programming a client | p. 437 |
Programming a server | p. 437 |
Security | p. 439 |
Sample Programs | p. 440 |
Objective type questions | p. 448 |
Exercises | p. 449 |
Answers | p. 450 |
New Language Features of Java 1.5 | p. 451 |
Introduction | p. 451 |
Generics | p. 452 |
The Enhanced for Loop | p. 453 |
Autoboxing and Unboxing | p. 455 |
Type-Safe Enumerations | p. 456 |
Variable-Length Arguments | p. 456 |
Formatted I/O | p. 457 |
Static Import | p. 458 |
Metadata (Annotations) | p. 459 |
Sample Programs | p. 460 |
Index | p. 467 |
Table of Contents provided by Ingram. All Rights Reserved. |
The New copy of this book will include any supplemental materials advertised. Please check the title of the book to determine if it should include any access cards, study guides, lab manuals, CDs, etc.
The Used, Rental and eBook copies of this book are not guaranteed to include any supplemental materials. Typically, only the book itself is included. This is true even if the title states it includes any access cards, study guides, lab manuals, CDs, etc.