Contents

Preface

Acknowledgements

1 INTRODUCTION TO OOPS

1.1 Structured Introduction

1.1.1 Sequence Structure

1.1.2 Loop or Iteration Structure

1.1.3 Decision Structure

1.2 Procedural Programming

1.3 Programming Methodology

1.4 Object-oriented Programming

1.5 Basic Concepts of OOPs

1.6 Characteristics of OOPs

1.7 Advantages of OOPs

1.8 Object-oriented Languages

1.9 Object-based Languages

2 MARCHING TOWARDS JAVA AND JAVA BYTECODES

2.1 Introduction: What is Java?

2.2 Evolution of Java

2.3 Main Benefits of Using Java

2.4 Key Features of Java

2.5 Java Character Set

2.5.1 Java Tokens

2.6 Variables

2.7 How to Put Comments in Java?

2.8 Data Types in Java

2.9 Structure of a Java Program

2.10 Your First Program in Java

2.10.1 Compiling and Running the Program (DOS Based)

2.11 Java is Free Form

2.12 Programming Examples

2.13 Reading Using Scanner

2.14 Command Line Arguments

2.15 Using Constants

2.16 Bytecode and JVM

2.16.1 What is the Java Virtual Machine? Why is it Here?

2.16.2 What are Java Bytecodes?

2.16.3 Virtual Parts

2.16.4 The Proud, the Few, the Registers

2.16.5 The Method Area and the Program Counter

2.16.6 The Java Stacks and Related Registers

2.16.7 The Garbage-collected Heap

2.16.8 What is in a Class File?

2.17 Why Understand Bytecode?

2.17.1 How to Get Bytecode?

2.17.2 Implementation of Bytecode Works

2.18 The Java Platform

2.19 Java, Internet and WWW

2.20 JDK Tools

2.21 Ponderable Points

3 INTRODUCTION TO OPERATORS AND EXPRESSION IN JAVA

3.1 Introduction

3.1.1 Binary Operators

3.1.2 Unary Operators

3.1.3 Expressions

3.2 Arithmetic Operators

3.3 Relation and Ternary Operator

3.4 Logical Operator

3.4.1 Logical AND (&&)

3.4.2 Logical OR

3.4.3 Logical NOT (!)

3.5 Assignment Operator

3.6 Increment (+ +) and Decrement (- -) Operator

3.7 Bitwise Operators

3.7.1 Bitwise AND (&)

3.7.2 Bitwise OR (|)

3.7.3 Bitwise XOR (^)

3.7.4 1's Complement (~)

3.7.5 Left Shift Operator (<<)

3.7.6 Right Shift Operator (>>)

3.7.7 Right Shift with Zero Fill (>>>)

3.8 The InstanceOf Operator

3.9 The Comma Operator

3.10 The sizeof() Operator

3.11 Precedence of Operator

3.12 Type Conversion and Typecasting

3.13 Mathematical Functions

3.14 Scope and Lifetime

3.15 Ponderable Points

4 WORKING WITH DECISION-MAKING STATEMENT IN JAVA

4.1 Introduction

4.2 The if Statement

4.3 The if-else Statement

4.4 Nesting of if-else Statement

4.5 else-if Ladder

4.6 Switch-Case Statement

4.7 Introduction of Loops

4.7.1 The while Loop

4.7.2 The for Loop

4.8 Different Syntaxes of for Loop

4.9 Programming Examples

4.9.1 Nesting of for Loop

4.9.2 The do-while Statement

4.10 break and continue Statement

4.10.1 The break Statement

4.10.2 The continue Statement

4.10.3 Labelled break and continue Statement

4.11 Ponderabale Points

5 WORKING WITH ARRAY IN JAVA

5.1 Introduction

5.2 Creating Arrays in Java

5.3 Some Important Points About Array

5.4 Initializing 1-D Array

5.5 Programming Examples (Part-1)

5.6 Two-dimensional (2-D) Array

5.7 Three-dimensional (3-D) and Variable Column Length Arrays

5.7.1 3-D Array

5.8 Ponderable Points

6 FUNCTIONS IN JAVA

6.1 Introduction

6.2 Function Declaration and Definition

6.3 No Return Type but Arguments

6.3.1 Returning Prematurely from Function

6.4 Function with Parameters and Return Type

6.5 Recursion

6.6 Function Overloading

6.7 Ponderable Points

7 CLASSES AND OBJECTS

7.1 Introduction

7.2 Programming Examples

7.3 Accessing Private Data

7.4 Passing and Returning Objects

7.5 Copying Objects

7.6 Array of Objects

7.7 Static Class Members

7.7.1 Static Member Functions

7.7.2 Static Data Members

7.8 Constructors

7.8.1 Constructors with Parameters

7.9 Copy Constructor

7.10 The this Reference

7.11 Garbage Collection and Finalize Method

7.12 The Final Keyword Revisited

7.12.1 Blank Finals

7.12.2 Final Arguments to Methods

7.13 Ponderable Points

8 INHERITANCE IN JAVA

8.1 Introduction

8.2 Types of Inheritance

8.2.1 Single-level Inheritance

8.2.2 Multilevel Inheritance

8.2.3 Multiple Inheritance

8.2.4 Hierarchical Inheritance

8.2.5 Hybrid Inheritance

8.3 Programming Examples

8.4 Method Overriding

8.5 Dynamic Method Dispatch

8.6 Hierarchical Inheritance Revisited

8.7 The Super Keyword

8.8 Constructor and Inheritance

8.9 Object Slicing

8.10 Final Class

8.11 Abstract Class

8.12 Ponderable Points

9 PACKAGES AND INTERFACES

9.1 Introduction

9.2 Package Types

9.2.1 Built-in Packages

9.2.2 User-defined Packages

9.3 Interfaces

9.3.1 Interface Declaration

9.3.2 Interface Implementation

9.3.3 Programming Examples

9.3.4 Extending Classes and Interfaces

9.4 Ponderable Points

10 STRING AND STRING BUFFER

10.1 The String Class

10.2 Constructors for String Class

10.3 Methods of String Class

10.4 Programming Examples (Part 1)

10.5 The StringBuffer Class

10.6 Constructor of StringBuffer Class

10.7 Methods of StringBuffer Class

10.8 Programming Examples (Part 2)

10.9 Ponderable Points

11 EXCEPTION HANDLING

11.1 Introduction

11.2 What is Exception?

11.3 Basis for Exception Handling

11.4 Exception-Handling Mechanism

11.5 Exception Classes in Java

11.5.1 Runtime Exception

11.5.2 Checked versus Unchecked Exception

11.6 Without Try-Catch

11.7 Exception Handling Using Try and Catch

11.8 Creating Your Own Exception

11.9 Ponderable Points

12 THREADS IN JAVA

12.1 Introduction

12.2 Creating Threads

12.2.1 Extending Thread Class

12.2.2 Thread Methods

12.2.3 Implementing Thread Using Runnable

12.3 Thread Priority

12.4 Thread Synchronization

12.4.1 The Synchronized Method

12.4.2 The Synchronized Statement

12.5 Thread Communication

12.6 Suspended and Resuming Threads

12.7 Daemon Threads

12.8 Ponderable Points

13 STREAMS AND FILES

13.1 Introduction

13.2 Working with Files

13.2.1 Method of File Class

13.3 Types of Streams

13.3.1 Character Streams

13.3.2 Programming Examples

13.3.3 Byte Stream

13.4 Reading from Console

13.5 Writing to Console

13.6 Reading and Writing Files

13.7 Ponderable Points

14 APPLET AND GRAPHICS PROGRAMMING

14.1 Introduction

14.2 Applet versus Application Programs

14.3 The Applet Class

14.4 Writing the First Applet

14.5 Life Cycle of an Applet

14.6 Applet Tag and Applet Parameters

14.7 Passing Parameter to Applet

14.8 The Paint, Update and Repaint Method

14.8.1 The Paint Method

14.8.2 The Update Method

14.8.3 The Repaint Method

14.9 Getdocumentbase() and Getcodebase() Methods

14.10 The AppletContext Interface

14.11 Playing Audio in Applet

14.11.1 Playing Audio Using Play Method of Applet Class

14.11.2 Playing Audio Using AudioClip Interface

14.12 Working with Graphics Class

14.12.1 Drawing Lines and Rectangles

14.12.2 Drawing Ovals and Circles

14.12.3 Drawing Polygon

14.12.4 Using Color

14.12.5 Setting the Drawing Mode

14.12.6 Programming Example

14.13 Working with Fonts

14.14 The FontMetrics Class

14.15 Ponderable Points

15 EVENT HANDLING

15.1 Introduction

15.2 The Delegation Event Model

15.3 The Event Classes

15.4 Event Listeners

15.5 Event Sources

15.6 Discussion of Event Classes

15.7 The Listeners Interfaces

15.8 Programming Example

15.8.1 Handling Mouse Events

15.8.2 Handling Keyboard Events

15.9 Adapter Classes

15.10 Nested and Inner Classes

15.10.1 Inner Classes in Methods and Scopes

15.10.2 Static Nested Class

15.10.3 Inner Classes in Event Handling

15.10.4 Anonymouse Inner Class

15.11 Ponderable Points

16 WORKING WITH AWT

16.1 Introduction to AWT

16.2 Structure of the AWT

16.3 AWT Window Hierarchy

16.3.1 The Component Class

16.3.2 The Container Class

16.3.3 The Panel Class

16.3.4 The Window Class

16.3.5 The Frame Class

16.3.6 Applet Frame Class

16.4 AWT Controls

16.4.1 The Button Control

16.4.2 The Label Class

16.4.3 The Checkbox Class

16.4.4 The CheckboxGroup Class

16.4.5 The List Class

16.4.6 The Choice Class

16.4.7 The Scrollbar Class

16.4.8 The Textfield Class

16.4.9 The TextArea Class

16.5 Menu and Menubars

16.5.1 Adding Shortcut Key to Menu

16.6 Popup Menus

16.7 Dialogs

16.8 The FileDialog Class

16.9 Ponderable Points

17 WORKING WITH LAYOUT

17.1 Layout and Layout Manager

17.2 FlowLayout

17.3 BorderLayout

17.4 GridLayout

17.5 GridBagLayout

17.6 CardLayout

17.7 Insets

17.8 Ponderable Points

18 THE COLLECTION FRAMEWORK

18.1 Introduction

18.2 Collection Framework

18.2.1 Collection Interface

18.2.2 The List Interface

18.2.3 The Set Interface

18.2.4 The SortedSet Interface

18.3 The Collection Class

18.4 ArrayList and LinkedList Classes

18.4.1 Maintaining the Capacity

18.4.2 The LinkedList Class

18.5 Iterating Elements of Collection

18.5.1 The ListIterator Interface

18.6 HashSet and TreeSet Classes

18.6.1 HashSet Class

18.6.2 TreeSet Class

18.7 Working with Maps

18.7.1 The Map Interface

18.7.2 Map.Entry Interface

18.7.3 The SortedMap Interface

18.8 Working with Map Classes

18.9 The Comparator Interface

18.10 Historical Collection Classes

18.11 Algorithm Support

18.12 Ponderable Points

19 BASIC UTILITY CLASSES

19.1 Introduction

19.2 The StringTokenizer Class

19.3 The Date Class

19.4 The Calendar Class

19.5 The Random Class

19.6 Observable Class and Observer Interface

19.7 The System Class

19.7.1 Environment Variables/Property

19.8 The Object Class

19.8.1 The Clone Method

19.9 The Class Class

19.10 The Runtime Class

19.11 The Process Class

19.12 Wrapper Class

19.12.1 The Number Class

19.12.2 The Byte, Short, Integer and Long Class

19.12.3 The Float and Double Class

19.12.4 Methods of Float/Double Class

19.12.5 The Character Class

19.12.6 The Boolean Class

19.13 Ponderable Points

20 NETWORKING IN JAVA

20.1 How Do Computers Talk to Each Other via Internet?

20.2 Java.Net Package

20.3 Internet Addressing with Java

20.4 Socket Fundamentals

20.4.1 Internet Domain Sockets

20.5 Sockets in Java

20.5.1 Step-by-step Socket Application Development

20.5.2 The Server

20.5.3 The Client

20.5.4 Thread Chat Server and Client

20.5.5 Datagram

20.6 URL

20.6.1 An Example of URL

20.6.2 Creating Relative URLs

20.6.3 The MalformedURLException

20.7 Ponderable Points

21 MISCELLANEOUS TOPICS: JNI, SERIALIZATION AND RMI

21.1 Java Native Interface (JNI)

21.1.1 Role of the JNI

21.1.2 An Example of JNI

21.1.3 Limitations of Using JNI

21.2 Serialization

21.2.1 Class and Interfaces for Serialization

21.3 RMI

21.3.1 Writing RMI Service

21.4 Ponderable Points

22 WORKING WITH IMAGES

22.1 Introduction

22.2 Drawing an Image

22.3 The ImageObserver Interface

22.3.1 Why Override ImageUpdate?

22.4 Double Buffering

22.5 The MediaTracker Class

22.6 Producing Image Data

22.7 Consuming Image Data

22.8 Ponderable Points

23 INTRODUCTION TO SWING

23.1 What is Swing?

23.2 The JApplet Class

23.3 The ImageIcon Class

23.4 The JLabel Class

23.5 The JButton Class

23.6 The JTextField Class

23.7 The JCheckBox Class

23.8 The JRadioButton Class

23.9 The JComboBox Class

23.10 The JTabbedPane Class

23.11 The JScrollPane Class

23.12 The JSplitPane Class

23.13 Dialogs

23.14 File Selection Dialog

23.15 The JColorChooser Class

23.16 The JTable Class

23.17 The JToolBar Class

23.18 The JProgressBar Class

23.19 The JSlider Class

23.20 The JTree Class

23.21 Examples of Menus

23.22 Ponderable Points

24 INTRODUCTION TO VIRTUAL MACHINE AND API PROGRAMMING

24.1 Introduction

24.2 Virtual Machine

24.3 Virtual Machine Errors

24.4 Instruction Set for Virtual Machine

24.5 Invoking Methods Using Virtual Machine

24.6 Class Instance and Virtual Machine

24.7 Array and Virtual Machine

24.8 Switch Statements and Virtual Machine

24.9 Throwing and Handling Exceptions, and Virtual Machine

24.10 Java Base API

24.10.1 Java Applet API

24.11 Java Standard Extension API

24.11.1 Java Security API

24.11.2 Java Media API

24.11.3 Java Enterprise API

24.11.4 Java Commerce API

24.11.5 Java Server API

24.11.6 Java Management API

24.12 The Java API Package

24.13 Ponderable Points

Sample Project

A1 Java Keyword Reference

A2 Creating Java Executables

A3 The Jar Tool

Index

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

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