Java Programming PDF
Java Programming PDF
Programming
Third Edition
Dr.P.Rizwan Ahmed
Margham Publications
Java
Programming
(Fundamentals of Java, Applet, AWT, Swing, Servlets, Java Beans, EJB
and JSP)
( For B. Sc Computer Science, B.Sc., Software Computer Science, B.Sc. ISM, B.Sc. IT,
B.Sc. Software System, B.Sc. Software Engineering, B.Sc.(Physics with CA),
B.Sc.(Mathematics with CA),B.Sc.(Software System), B.Sc.(Electronics),
B.Sc.(Electronics and Communication Systems), B.Com (CA),B.Com(IT), BCA,
M.Sc. Computer Science, M.Sc. Information Technology, M.Sc.(Mathematics), M.Sc.
Software Engineering, MCA, and IT Professionals.)
THIRD EDITION
Dr.P.Rizwan Ahmed,MCA.,M.Sc.,M.A.,M.Phil.,Ph.D,
Head of the Department
Department of Computer Applications &
Post Graduate Department of Information Technology
Mazharul Uloom College, Ambur – 635 802
Tamil Nadu, INDIA.
Margham Publications
No.24, Rameswaram Road, T- Nager,
Chennai- 600 017 Phone:(044) 2432 2469
Web Site: www.margham.in
E-mail: www.margham.tn@gmail.com
CONTENTS
Preface
Acknowledgement
3.1 Operators
3.1.1 Arithmetic Operators
3.1.2 Relational Operators
3.1.3. Logical Operators
3.1.4. Assignment Operators
3.1.5 Increment and Decrement Operators
3.1.6 Bitwise Operators
3.1.7 Conditional Operator
3.1.8 Special Operators
3.2 Control Statement
3.2.1. Decision – making statement
3.2.1.1 Simple if statement
3.2.1.2. if…else Statement
3.2.1.3 Nested-if statement
3.2.1.4. Switch Statement
3.3 Looping Statement
3.3.1 While loop
3.3.2 Do - while
3.3.3 for loop
3.4 Jump statement
3.4.1Break statement
3.4.2 Continue Statement
Summary
Review Question
5.1 Class
5.1.1 Defining Methods
5.1.2 Creating Objects
5.1.3 Accessing Class Members
5.2 Constructor
5.2.1 Default Constructor
5.2.2 Parameterized Constructor
5.3 Method Overloading
5.4 Access Control
5.5 Static and Fixed Methods
5.6 Inner Class
5.7 String Class
5.8 StringBuffer Class
Summary
Review Questions
Chapter 6 Inheritance
6.1 Inheritance
6.1.1 Deriving a Subclass
6.2 Overriding methods
6.3 Using super keyword
6.4 Difference between method overloading and method overriding in java
6.5 Abstract Class
Summary
Review Questions
Chapter 7 Wrapper class, Auto boxing and Auto Unboxing
12.1 Introduction
12.2 Event Handling
12.3 Mouse Event Handling
12.4 Adapter Classes
12.5 Key Event Handling
Summary
Review Questions
15.1Packages
15.1.1 Creating Package
15.1.2Hierarchy of Package: / Multileveled Package:
15.2 CLASSPATH
15.3 Importing Packages
15.4 Creating our own package
15.5 Advantages of Packages
15.6 Interface
15.6.1 Defining an interface
15.6.2 Extending interface
15.6.3 Implementing Interface
15.6.4 Differences between Classes and Interfaces
15.6.5 Difference between Abstract class and Interface
Summary
Review Questions
16.1 Introduction
16.2 Errors and its types
16.3 Exception Handling
16.3.1 Exception Handling Mechanism
16.3.2 Classification of Exception (or) Exception classes
16.3.3 Built in Exceptions
16.3.4 Using try and catch block
16.3.5 Catching Exceptions
16.3.6 Multiple catch clauses
16.3.7 Throw Statement
16.3.8 Throws Clause
16.3.9 Finally Clause
Summary
Review Questions
Chapter 17 Multithreading
17.1 Multithreading
17.2 Advantages of Multithreading
17.3 Thread
17.4 Life Cycle of a Thread
17.5 Creating a thread
17.5.1 Extending the class Thread
17.5.2 Implementing Runnable Interface
17.6 Synchronization
17.7 Interthread Communication
17.8 Dead lock
Summary
Review Questions
Chapter 19 Applets
19.1 Applets
19.2 Advantages and Disadvantages of Applet
19.3 Creating and Executing an Applet
19.3.1 Understanding the program
19.4 HTML Tags
19.5 Life cycle of an applet
19.6 Applet Tags in HTML
19.7 Passing Parameters to Applets
Summary
Review Questions
25.1 Introduction
25.2 Advantages of JSP
25.3 Benefits of JSP
25.4 The Anatomy of JSP
25.5 JSP Architecture
25.6 JSP Life Cycle
25.7 JSP Syntax
25.8 JSP Directives
25.8.1 Page Directive
25.8.2 Include Directive
25.8.3 Taglib Directive:
25.9 Setting up the JSP Environment & Installation of JDK Java
25.10 Create and Run a Simple JSP Program using Tomcat
25.11 A Simple Program
Summary
Review Questions
APPENDICES
APPENDIX-A: Solved Problems