75% found this document useful (4 votes)
1K views13 pages

Object Oriented Programming (Java)

CS3391 - Object Oriented Programming - As per the Latest Syllabus of Anna University, Chennai - Regulation 2021 - Common to all Branches
Copyright
© © All Rights Reserved
Available Formats
Download as PDF, TXT or read online on Scribd
Download as pdf or txt
75% found this document useful (4 votes)
1K views13 pages

Object Oriented Programming (Java)

CS3391 - Object Oriented Programming - As per the Latest Syllabus of Anna University, Chennai - Regulation 2021 - Common to all Branches
Copyright
© © All Rights Reserved
Available Formats
Download as PDF, TXT or read online on Scribd
Download as pdf or txt
Download as pdf or txt
You are on page 1/ 13

Object Oriented Programming (Java)

(CS3391 - Object Oriented Programming)

As per the Latest Syllabus of Anna University, Chennai

(Regulation 2021)

Mr. K. Sriram Kumar, B.E., M.E.,


Assistant Professor

Department of Information Technology


Karpagam Institute of Technology

Coimbatore

Mr. P. Krishna Sankar, B.E., M.E.,

Freelance Java Developer / Trainer / Consultant


Kavindapadi

A.R.S. Publications
No. 11, Veerabathra Nagar, Part II,
8th Street, Medavakkam,
Chennai – 600 100, Tamil Nadu, India.
Phone: 044 – 48587467, Mobile: 9840025186
eMail: arspublications@gmail.com
web: www.arspublications.com
PREFACE

This book “Object Oriented Programming” is about basic idea towards object oriented programming with Java.

It provides clear view towards object oriented mechanism adapted in programming languages. It provides a

preliminary study on understanding Java with several illustration program. It affords procedural footsteps from

command-line to graphical user interface.

Unit I: Introduction towards Object Oriented Programming concepts in Java. Provides a procedure for

writing, compiling and executing a Java program. Contributes a knowledge on datatypes, variables,

arrays, operators, control flow and structure statement, Class and Constructors.

Unit II: Outline on Java Overloading, Inheritance, Interface and Package with understanding to distinct

access specifiers.

Unit III: Transitory awareness on Wrappers, Exception handling and Multithreading. Provides a procedure

for writing a multithreading application with priority, daemon threads, synchronizing of thread and

inter thread communication.

Unit IV: A preliminary confab over Generic programming through classes, methods and its limitations in

Java. Brief knowledge over basic Input / Output operations performed through streams on Console

and File. It provides detailed understanding to object cloning and String manipulation.

Unit V: Provides a study over graphical user interfacing JavaFX. Understanding towards window

development and its components. Building up desktop application with simple form designing with

several layout using the JavaFX.


CS3391 OBJECT ORIENTED PROGRAMMING LTPC

3003

UNIT I INTRODUCTION TO OOP AND JAVA 9

Overview of OOP – Object oriented programming paradigms – Features of Object Oriented Programming –

Java Buzzwords – Overview of Java – Data Types, Variables and Arrays – Operators – Control Statements

– Programming Structures in Java – Defining classes in Java – Constructors Methods -Access specifiers -

Static members- Java Doc comments

UNIT II INHERITANCE, PACKAGES AND INTERFACES 9

Overloading Methods – Objects as Parameters – Returning Objects –Static, Nested and Inner Classes.

Inheritance: Basics– Types of Inheritance -Super keyword -Method Overriding – Dynamic Method Dispatch

–Abstract Classes – final with Inheritance. Packages and Interfaces: Packages – Packages and Member

Access –Importing Packages – Interfaces.

UNIT III EXCEPTION HANDLING AND MULTITHREADING 9

Exception Handling basics – Multiple catch Clauses – Nested try Statements – Java’s Built-in Exceptions –

User defined Exception. Multithreaded Programming: Java Thread Model–Creating a Thread and Multiple

Threads – Priorities – Synchronization – Inter Thread Communication- Suspending –Resuming, and Stopping

Threads –Multithreading. Wrappers – Auto boxing.

UNIT IV I/O, GENERICS, STRING HANDLING 9

I/O Basics – Reading and Writing Console I/O – Reading and Writing Files. Generics: Generic Programming

– Generic classes – Generic Methods – Bounded Types – Restrictions and Limitations. Strings: Basic String

class, methods and String Buffer Class.

UNIT V JAVAFX EVENT HANDLING, CONTROLS AND COMPONENTS 9

JAVAFX Events and Controls: Event Basics – Handling Key and Mouse Events. Controls: Checkbox,

ToggleButton – RadioButtons – ListView – ComboBox – ChoiceBox – Text Controls – ScrollPane. Layouts –

FlowPane – HBox and VBox – BorderPane – StackPane – GridPane. Menus – Basics – Menu – Menu bars

– MenuItem.
Contents
UNIT I

INTRODUCTION TO OOP AND JAVA FUNDAMENTALS


1.1 Object Oriented Programming

1.1.1 Abstraction

1.1.2 Objects and Classes

1.1.3 Encapsulation

1.1.4 Inheritance

1.1.5 Polymorphism

1.1.6 OOP in Java

1.2 Characteristics of Java

1.3 The Java Environment

1.3.1 Java Source File

1.3.2 Structure

1.3.3 Compilation

1.4 Fundamental Programming Structures in Java

1.5 Defining classes in Java

1.5.1 Declaration

1.5.2 Object

1.5.3 Constructors

1.5.4 Methods

1.5.5 Access specifiers

1.5.6 Static members

1.6 Comments

1.7 Data Types

1.7.1 Primitive Data Types

1.7.2 Reference / Object Data Types

1.8 Variables
1.8.1 Local Variables

1.8.2 Instance variables

1.8.3 Class / Static variables

1.9 Operators

1.9.1 Arithmetic Operators

1.9.2 Relational Operator

1.9.3 Logical Operator

1.9.4 Bitwise Operator

1.9.5 Assignment Operator

1.9.6 Increment & Decrement Operator

1.10 Control Flow

1.10.1 Conditional Statements

1.10.2 Looping Statements

1.11 Arrays

1.11.1 Declarations

1.11.2 Initialization / Instantiation

1.11.3 Creation

1.11.4 Basic Functions of Array Class

1.11.5 Types of Arrays

1.12 Packages

1.12.1 Java API packages

1.12.2 User defined packages

1.13 JavaDoc comments

1.13.1 How to Insert Comments

1.13.2 Class Comments

1.13.3 Method Comments

1.13.4 Field Comments

1.13.5 General Comments

1.13.6 How to Extract Comments


UNIT II

INHERITANCE AND INTERFACES


2.1 Inheritance

2.1.1 Super classes

2.1.2 Sub classes

2.1.3 Inheritance Type

2.1.4 Protected members

2.1.5 Constructors in sub classes

2.2 Object class

2.3 Abstract Classes and Methods

2.3.1 Abstract Class

2.3.2 Abstract Method

2.3.3 Important points to be notes while using abstract class and methods

2.4 Final Keyword

2.4.1 Final Class

2.4.2 Final Method

2.4.3 Final Variable

2.5 Interfaces

2.5.1 Defining an interface

2.5.2 Implementing interface

2.5.3 Accessing Implementations through Interface Reference

2.5.4 Differences between classes and interfaces

2.5.5 Extending interfaces

2.6 Object cloning

2.6.1 Points to be remembered while Cloning the Object

2.6.2 Types of Cloning

2.7 Inner classes

2.7.1 Instance Inner Class: (Inner Class)


2.7.2 Local Inner Class: (Method Class)

2.7.3 Anonymous Inner Class

2.8 Array Lists

2.8.1 List

2.8.2 Array List

2.8.3 ArrayList class members

2.8.4 Accessing elements from the ArrayList

2.9 Strings

2.9.1 Creating Strings

2.9.2 String Operations

UNIT III

EXCEPTION HANDLING AND I/O


3.1 Exceptions

3.1.1 Exception hierarchy

3.1.2 Throwing and catching exceptions

3.1.3 Built-in exceptions

3.1.4 Creating own exceptions

3.1.5 Stack Trace Element

3.2 Input / Output Basics

3.2.1 Streams

3.2.2 Byte streams

3.2.3 Character Stream

3.2.4 Reading and Writing Console

3.2.5 Reading and Writing Files

UNIT IV

MULTITHREADING AND GENERIC PROGRAMMING


4.1 Differences between multi-threading and multitasking

4.2 Thread life cycle


4.3 Creating threads

4.3.1 Create Thread by Implementing Runnable

4.3.2 Create Thread by Extending Thread

4.4 Synchronizing threads

4.5 Inter-thread communication

4.6 Daemon threads

4.7 Thread groups

4.8 Generic Programming

4.8.1 Generic classes

4.8.2 Generic methods

4.8.3 Bounded Types

4.8.4 Restrictions and Limitations

UNIT V

EVENT DRIVEN PROGRAMMING


5.1 Graphics programming

5.1.1 Lifecycle methods for Applet

5.1.2 Component class: java.awt.Component

5.1.3 Window class: java.awt.Window

5.1.4 Frame

5.1.5 Creating a Frame Window

5.2 Working with 2D shapes

5.2.1 Graphics: Available in java.awt.Graphics

5.2.2 Java Coordinate System

5.2.3 Lines

5.2.4 Rectangles

5.2.5 Polygons

5.2.6 Ovals

5.2.7 Arc

5.2.8 Drawing Text


5.3 Using color: java.awt.Color

5.3.1 java.awt.Component

5.3.2 java.awt.Graphics

5.4 Using font: java.awt.Font

5.5 Using image: java.awt.Image

5.6 Basics of event handling

5.6.1 Event handlers

5.6.2 Adapter classes

5.6.3 Actions

5.6.4 Mouse events

5.6.5 AWT event hierarchy

5.7 Introduction to Swing

5.7.1 Hierarchy of Java Swing classes

5.7.2 Commonly used Methods of Component class

5.7.3 Java Swing Examples

5.8 Layout management

5.8.1 BorderLayout

5.8.2 FlowLayout

5.8.3 GridLayout

5.8.4 CardLayout

5.8.5 GridBagLayout - Gridlayout without limitations

5.8.6 BoxLayout– javax.swing

5.9 Swing Components

5.9.1 Text Fields

5.9.2 Text Areas

5.9.3 Buttons

5.9.4 Check boxes

5.9.5 Radio Buttons

5.9.6 List
5.9.7 Choices

5.9.8 Scrollbars

5.9.9 Windows

5.9.10 Menus

5.9.11 Dialog Boxes

Unit VI 2

Appendix 2

6.1. Java Buzzwords 2

6.1.1. Overview of Java 2

6.2. Overloading Methods 3

6.2.1. Objects as Parameters 6

6.2.2. Returning Objects 7

6.2.3. Static class 9

6.2.4. Super keyword 9

6.2.5. Method Overriding 11

6.3. Rules for Java Method Overriding 12

6.3.1. Overriding method must satisfy the following points 12

6.3.2. Usage of Java Method Overriding 12

6.3.3. Using super to Call an Overridden Method 13

6.3.4. Dynamic Method Dispatch 13

6.3.5. Difference between Method Overloading and Method Overriding: 14

6.4. Wrapper Class 15

6.4.1. Need for Wrapper class 15

6.4.2. Boolean class 15


6.4.3. Character class 16

6.4.4. Integer class 16

6.4.5. Double Class 17

6.5. AutoBoxing & UnBoxing 17

6.6. String Buffer Class 20

You might also like