Sunteți pe pagina 1din 12

Java

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

Chapter – 1 Basic Concepts of Object Oriented Programming


1.1 Object Oriented Programming (OOP)
1.2 Features of Object Oriented Programming
1.3 Procedure Oriented Programming
1.3.1 Features of procedure oriented Programming
1.3.2 Difference between Procedure Oriented Programming and Object Oriented
Programming (OOP)
1.4 Basic Concepts of OOPs
1.4.1 Objects
1.4.2 Classes
1.4.3 Data Abstraction
1.4.4 Encapsulation
1.4.5 Inheritance
1.4.6 Polymorphism
1.4.7 Dynamic binding
1.4.8 Message Passing
1.5 Benefits of OOP
1.6 Advantages of OOP
1.7 Applications of OOP / Usage of OOP
Summary
Review Questions

Chapter 2 Fundamentals of Java Programming


2.1 History of Java
2.2 Java Evolution
2.3 Characteristics of Java
2.4 Getting and Installing Java
2.5 Setting up Java Environment
2.6 Features of Java / Java Buzzwords / Characteristics of Java
2.7 Difference between C and Java
2.8 Difference between C++ and Java
2.9 Introduction to Java
2.9.1 What is Java?
2.9.2 Types of java program
2.10 Differentiate Application and Applet program
2.11 Creating and executing Java program
2.12 Java Virtual Machine (JVM)
2.13 Character Set
2.14 Java Tokens
2.14.1 Keywords
2.14.2 Identifiers
2.14.3 Literals
2.14.4 Operators
2.14.5 Separators
2.15 Structure of a Java Program
2.16 Comments in java program
2.17 Data Types
2.18 Variables
2.19 Type Casting
2.20 Arrays
2.20.1 One dimensional array
2.20.2 Two dimensional arrays
2.21 Command Line Arguments
Summary
Review Question

Chapter 3 Operators and Control Statements

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

Chapter 4 Input and Output Statements

4.1 Input Statements


4.1.1 Scanner Class
4.2 System Class
4.2.1 Output Statement
Summary
Review Question

Chapter 5 Classes and Objects

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

7.1 Type-Wrapper Classes for Primitive Types


7.2 Autoboxing and Auto-Unboxing
7.2.1 Benefits of Autoboxing / Unboxing
7.3 Recursion: Factorials
Summary
Review Questions

Chapter 8 Abstract Windowing Toolkit (AWT) - I

8.1 Working with windows using AWT Controls


8.2 Label
8.3 Button
8.4 Check Box
8.5 Choice
Summary
Review Questions

Chatper-9 Abstract Windowing Toolkit (AWT) - II

9.1. Text Components


9.1.1. TextFields
9.1.2 Text Area
9.2 Lists
9.3Scrollbars
Summary
Review Questions

Chapter 10 Swing Components-I

10.1 Swing: Introduction


10.2 Swing Features
10.3 Difference between Swing and AWT
10.4 GUI Components
10.5 Common GUI Event types and Listener Interfaces
10.6 JOptionPane class
10.7 JLabel class
10.8 JText Components
10.8.1 JTextField
10.8.2 JText Area class
10.9 JButton class
Summary
Review Questions
Chapter 11 Swing Components-II

11.1 JCheckBox Class


11.2 JComboBox
11.3 JSlider
11.4 JList
11.5 JFrame
11.6 JPanel
Summary
Review Questions

Chapter 12 Event Handling

12.1 Introduction
12.2 Event Handling
12.3 Mouse Event Handling
12.4 Adapter Classes
12.5 Key Event Handling
Summary
Review Questions

Chapter 13 Layout Managers

13.1 Layout Manager


13.1.1 Flow Layout
13.1.2 Border Layout
13.1.3 Grid Layout
13.1.4 Card Layout
Summary
Review Questions

Chapter 14 Graphics and Java2D

14.1 Graphics and Java2D


14.1.1 Graphic Contexts and Graphic Objects
14.2 Color Control
14.3 Font Control
14.4 Graphics Class
14.4.1 Drawing Lines, Rectangles, Ovals and Arcs
14.4.1.1Drawing Lines
14.4.1.2 Drawing Rectangles
14.4.1.3 Drawing Ovals
14.4.1.4 Drawing Arcs
14.5 Using menus with frames
Summary
Review Questions

Chapter 15 Packages and Interfaces

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

Chapter 16 Exception Handling

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 18 I/O Streams

18.1 I/O Stream


18.1.1 ByteStream classes
18.1.2 Character Stream classes
18.2 File Stream
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

Chapter 20 Introduction to API Packages & JDBC Connectivity

20.1 Introduction to API Packages ( java.lang, java.util)


20.1.1 Java.lang package
20.1.2. Java.util package
20.2 Java Data Base Connectivity
20.2.1 How does JDBC Work?
20.2.2 Characteristics of JDBC
20.2.3 JDBC Drivers
20.2.4 Types to perform JDBC instructions
Summary
Review Questions
Chapter 21 Networking

21.1 Network Basics


21.2 Proxy Servers
21.3 URL (Uniform Resource Locator)
21.3.1 URL Class
21.4 Socket Programming
21.4.1 Establishing a simple server with stream sockets
21.4.2 Establishing a simple client with stream sockets
21.5 Datagram
21.5.1 Establishing a simple server using Datagram Sockets
21.5.2 Establishing a simple client using Datagram Socket
21.6 Net Address
21.7 Domain Name System (DNS)
Summary
Review Questions

Chapter 22 Web Servers and Servlets

22.1 Tomcat Web Server


22.2 Downloading and Installing Tomcat
22.3 Introduction
22.4 What is a Servlet?
22.5 Features of Servlets
22.6 Uses of Servlets
22.7 Advantages of Servlet
22.8 Difference between Applets and Servlets
22.9 Requirements of Java Servlets
22.10 Servlet Life Cycle
22.11 Servlet API
22.11.1 The javax.servlet Package
22.11.2 The javax.servlet.http Package
22.12 Creating and Executing Servlets
22.13 Your First Java Servlet
22.14 Using GenericServlet Class
22.15 Using HttpServlet Class
22.15.1 The doGet() Method
22.15.2 The doPost() Method
22.17 Session Tracking
22.18 Cookies
22.19 Servlets and JDBC
22.20 Sample Program
Summary
Review Questions

Chapter 23 Java Beans

23.1 JavaBeans: An Introduction


23.2 JavaBeans Concepts
23.3 Advantages of Java Beans
23.4 Elements of a JavaBeans
23.5 Types of JavaBeans
23.6 Bean Properties
23.6.1 Different Types of Properties
23.7 Bean Developer Kit (BDK)
23.8 Starting the BDK
23.9 Adding a Bean to the ToolBox
23.10 Dropping a Bean on the BeanBox
23.11 Editing Bean Properties
23.12 Saving and Restoring Beans
23.13 Using the BDK
23.13.1 Create and Configure an Instance of the Molecule Bean
23.13.2 Create and Configure an Instance of the OurButton
23.14 JAR Files
23.15 Creating Simple Bean
Summary
Review Questions

Chapter 24 Enterprise Java Beans (EJB)

24.1 Introduction to Enterprise JavaBeans


24.2 EJB History
24.3 Benefits of EJB
24.4 Difference between JavaBeans and Enterprise JavaBeans
24.5 Restrictions on EJB
24.6 Types of Enterprise JavaBeans
24.6.1 Session Beans
24.6.2 Entity Beans
24.6.3 Message-Driven Bean
24.7 EJB Architecture
Summary
Review Questions

Chapter 25 Java Server Pages (JSP)

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

APPENDIX-B: Questions and Answers

APPENDIX-C: Past University Question Papers

APPENDIX-D: Solutions for Past University Question Papers

S-ar putea să vă placă și