You are on page 1of 30

CORE JAVA

CR-Session 1
Source Topic/Activity Name
Module 1: Getting Started
Rationale
Objectives
What Is the Java™ Technology?
Primary Goals of the Java Technology
The Java Virtual Machine
Garbage Collection
The Java Runtime Environment
JVM™ Tasks
The Class Loader
The Bytecode Verifier
Demo: A Simple Java Application
Module 2: Object-Oriented Programming
Software Engineering
The Analysis and Design Phase
Analysis and Design Example
Abstraction
Classes as Blueprints for Objects
Declaring Java Technology Classes
Declaring Attributes
1 Declaring Methods
Accessing Object Members

Information Hiding
1

Encapsulation
Declaring Constructors
Demo: Constructors
Source File Layout
Software Packages
The package Statement
The import Statement
Directory Layout and Packages
Development
Compiling Using the-d Option
Deployment
Terminology Recap
Using the Java Technology API Documentation
Summary

CR(Session 2)

Module 3: Identifiers, Keywords and Types

Objectives
Comments
Semicolons, Blocks, and White Space
Identifiers
Java Programming Language Keywords
Basic Java Programming Language Types
Variables, Declarations, and Assignments
Java Reference Types
Demo: Java Reference Types
Constructing and Initializing Objects
Assigning References
Pass-by-Value
The this Reference
Java Programming Language Coding Conventions
Module 4: Expression and Flow Control
Variables
Variables and Scope
Variable Initialization
2
Initialization Before Use Principle
Operators
Operator Precedence
Logical Operators
Bitwise Logical Operators
Right-Shift Operators >> and>>>
Left-Shift Operator<<
Shift Operator Examples
String Concatenation With+
Casting
Promotion and Casting of Expressions
Branching Statements
Simple if,else Statements
Complex if,else Statements
The switch Statement
Looping Statements
Demo: Looping Statements
Summary

MR (Session 3)
Lab 1: Getting Started
Exercise 1: Exploring Java™Program Errors
Exercise 2: Creating a Test Program (Level 1) (Additional Exercise)
Exercise 2: Creating a Test Program (Level 2)
Exercise 2: Creating a Test Program (Level 3)
Lab 2: Object-Oriented Programming

Exercise 1: Using the Java API Documentation


Exercise 2: Exploring Encapsulation, Version 1 (Level 1) (Additional Exercise)

Exercise 2: Exploring Encapsulation, Version 1 (Level 2)


Exercise 2: Exploring Encapsulation, Version 1 (Level 3)
Exercise 3: Exploring Encapsulation, Version 2 (Level 1) (Additional Exercise)

Exercise 3: Exploring Encapsulation, Version 2 (Level 2)


Exercise 3: Exploring Encapsulation, Version 2 (Level 3)
3 Exercise 4: Creating Java Packages
Lab 3: Identifiers, Keywords and Types

Exercise 1: Investigating Reference Assignment


Exercise 2: Creating Customer Accounts (Level 1) (Additional Exercise)
Exercise 2: Creating Customer Accounts (Level 2)
Exercise 2: Creating Customer Accounts (Level 3)
Lab 4: Expression and Flow Control

Exercise 1: Using Loops and Branching Statements


Exercise 2: Using Conditional Statements in the Account Class (Level 1) (Additional Exercise)

Exercise 2: Using Conditional Statements in the Account Class (Level 2)


Exercise 2: Using Conditional Statements in the Account Class (Level 3)
Exercise 3: Using Nested Loops (Advanced)

CR (Session 4)
Module 5: Arrays
Objectives
Declaring Arrays
Demo: Creating Arrays
Demo: Creating Reference Arrays
Initializing Arrays
Multidimensional Arrays
Array Bounds
Using the Enhanced for Loop
Array Resizing
Copying Arrays
Module 6: Class Design
Subclassing
Single Inheritance
Access Control
Overriding Methods
Overridden Methods Cannot be Less Accessible
Invoking Overridden Methods
Polymorphism
Virtual Method Invocation
4 Heterogeneous Collections
Polymorphic Arguments
The instanceof Operator
Casting Objects
4

Overloading Methods
Methods Using Variable Arguments
Overloading Constructors
Constructors are Not Inherited
Invoking Parent Class Constructors
Constructing and Initializing Objects: A Slight Reprise

Constructor and Initialization Examples


The Object Class

The equals Method


The toString Method
Wrapper Classes

Autoboxing of Primitive Types


Summary

CR (Session 5)
Module 7:Advanced Class Features
Objectives
The static Keyword
Demo: The static Keyword
The final Keyword
Enumerated Types
Old-Style Enumerated Type Idiom
The New Enumerated Type
Advanced Enumerated Types
Static Imports
Abstract Classes
The Problem
The Solution
Interfaces
Demo: Interfaces
The Flyer Example
Multiple Interface Example
5 Uses of Interfaces
Module 8: Exceptions and Assertions
Exceptions and Assertions
Exceptions
Exception Example
The try-catch Statement
Call Stack Mechanism
The finally Clause
Exception Categories
Common Exceptions
The Handle or Declare Rule
Method Overriding and Exceptions
Creating Your Own Exceptions
Throwing a User-Defined Exception
Handling a User-Defined Exception
Assertions
Summary

MR (Session 6)
Lab 5: Arrays
Exercise 1 – Using Primitive Arrays (Level 2)
Exercise 1 – Using Primitive Arrays (Level 3)
Exercise 2 – Using Arrays to Represent One-to-Many Associations (Level 1) (Additional Exercise)

6
Exercise 2 – Using Arrays to Represent One-to-Many Associations (Level 2)
Exercise 2 – Using Arrays to Represent One-to-Many Associations (Level 3)
Lab 6: Class Design
Exercise 1: Creating Bank Account Subclasses (Level 1) (Additional Exercise)
6
Exercise 1: Creating Bank Account Subclasses (Level 2)
Exercise 1: Creating Bank Account Subclasses (Level 3)
Exercise 2: Creating a Heterogeneous Collection of Customer Accounts (Level 1) (Additional
Exercise)

Exercise 2: Creating a Heterogeneous Collection of Customer Accounts (Level 2)


Exercise 2: Creating a Heterogeneous Collection of Customer Accounts (Level 3)
Exercise 3: Creating a Batch Program (Advanced) (Additional Exercise)

CR (Session 7)
Module 9: Collections and Generics Framework
Objectives
The Collections API
Collection Implementations
The Map Interface
Legacy Collection Classes
Ordering Collections
The Comparable Interface
The Comparator Interface
7
Generics
Generics: Examining Type Parameters
Demo: Generics
Wild Card Type Parameters
Generics: Refactoring Existing Non-Generic Code
Iterators
The Enhanced for Loop
Summary

CR (Session 8)
Module 10: I/O Fundamentals
Objectives
Command-Line Arguments
System Properties
The Properties Class
I/O Stream Fundamentals
Data Within Streams
Byte Streams
Character Streams

8 Node Streams
Buffered Streams
I/O Stream Chaining
Processing Streams
Basic Byte Stream Classes
Serialization
Serialization and Object Graphs
Writing and Reading an Object Stream
Summary

MR (Session 9)
Lab 7:Advanced Class Features
Exercise 1: Applying Static Members to a Design (Level 1) (Additional Exercise)
Exercise 1: Applying Static Members to a Design (Level 2)
Exercise 1: Applying Static Members to a Design (Level 3)
Exercise 2:Working With Interfaces and Abstract Classes (Level 1) (Additional Exercise)
Exercise 2:Working With Interfaces and Abstract Classes(Level 2)
Exercise 2:Working With Interfaces and Abstract Classes(Level 3)
Lab 8: Exceptions and Assertions
9
Exercise: Creating Your Own Exception (Level 1) (Additional Exercise)
Exercise: Creating Your Own Exception (Level 2)
Exercise: Creating Your Own Exception (Level 3)
Lab 9: Collections and Generics Framework
Exercise 1: Using Collections to Represent Association(Level 1) (Additional Exercise)
Exercise 1: Using Collections to Represent Association(Level 2)
Exercise 1: Using Collections to Represent Association(Level 3)

CR (Session 10)
Module 10: I/O Fundamentals
Objectives
Basic Character Stream Classes
Module 11: Console I/ O and File I/O
Console I/O
Writing to Standard Output
Reading From Standard Input
Simple Formatted Output
Simple Formatted Input
Files and File I/O
Creating a New File Object

10
The File Tests and Utilities
File Stream I/O
10 Module 12: Building Java GUIs Using the Swing API
What are the Java Foundation Classes (JFC)?
What is Swing?
Pluggable Look-and-Feel
Swing Architecture
Swing Packages
Examining the Composition of a Java Technology GUI
Swing Containers
Top-level Containers
Swing Components
The Swing Component Hierarchy
Properties of Swing Components
Summary

CR (Session 11)
Module 12: Building Java GUIs Using the Swing API
Objectives
Layout Managers
The BorderLayout Layout Manager
The FlowLayout Layout Manager
The BoxLayout Layout Manager
The CardLayout Layout Manager
The GridLayout Layout Manager
The GridBagLayout Layout Manager
The GroupLayout Layout Manager
Demo: Creating a Swing GUI Application
GUI Construction
Programmatic Construction
Module 13: Handling GUI-Generated Events
What Is an Event?
Java SE Event Model
Delegation Model
A Listener Example
GUI Behavior
11
Event Categories
Complex Example
Multiple Listeners
Developing Event Listeners
Event Adapters
Event Handling Using Inner Classes
Event Handling Using Anonymous Classes
Demo: Event Handling
Concurrency in Swing
Module 14: GUI Based Applications
How to Create a Menu
Creating a JMenuBar
Creating a JMenu
Creating a JMenuItem
Creating a JCheckboxMenuItem
Demo: Adding Menus to the Container Components
Controlling Visual Aspects
Summary

MR (Session 12)
Lab 11: Console I/ O and File I/O
Exercise 1: Reading a Data File (Level 1) (Additional Exercise)
Exercise 1: Reading a Data File (Level 2)
Exercise 1: Reading a Data File (Level 3)
Lab 12: Building Java GUIs Using the Swing API
Exercise 1: Creating the ChatClient GUI Part 1 (Level 1) (Additional Exercise)
Exercise 1: Creating the ChatClient GUI Part 1 (Level 2)
Exercise 1: Creating the ChatClient GUI Part 1 (Level 3)
Exercise 2: Creating the Bank ATM GUI Part 1(Advanced) (Additional Exercise)
12 Lab 13: Handling GUI-Generated Events
Exercise 1: Creating the ChatClient GUI Part 2 (Level 1) (Additional Exercise)
Exercise 1: Creating the ChatClient GUI Part 2 (Level 2)
Exercise 1: Creating the ChatClient GUI Part 2 (Level 3)
Exercise 2: Creating the Bank ATM GUI Part 2(Advanced) (Additional Exercise)
Lab 14: GUI Based Applications
Exercise: Creating the ChatClient GUI, Part 3 (Level 1) (Additional Exercise)
Exercise: Creating the ChatClient GUI, Part 3 (Level 2) (Additional Exercise)
Exercise: Creating the ChatClient GUI, Part 3 (Level 3)

CR (Session 13)
Module 15: Threads
Objectives
Threads
Creating the Thread
Starting the Thread
Thread Scheduling
Terminating a Thread
Demo: Creating the Thread
Basic Control of Threads
Other Ways to Create Threads
13 Selecting a Way to Create Threads
13
Using the synchronized Keyword
The Problem
The Object Lock Flag
Releasing the Lock Flag
Using synchronized – Putting It Together
Thread States
Deadlock
Thread Interaction –wait and notify
Summary

CR (Session 14)
Module 15: Threads
Objectives
Thread Interaction
The wait and notify Methods
Thread States
Monitor Model for Synchronization
Putting It Together
The Producer Thread
The Consumer Thread
The SyncStack Class
The SyncTest Example
14 Module 16: Networking
Networking
Sockets
Setting Up the Connection
Addressing the Connection
Port Numbers
Java Networking Model
Minimal TCP/IP Server
Minimal TCP/IP Client
Demo: Networking
Summary

MR (Session 15)
Lab 15: Threads
Exercise: Using Multithreaded Programming (Level 1)
Exercise: Using Multithreaded Programming (Level 2)
Exercise: Using Multithreaded Programming (Level 3)
15 Lab 16: Networking
Exercise: Creating a Socket Client (Level 1) (Additional Exercise)
Exercise: Creating a Socket Client (Level 2)
Exercise: Creating a Socket Client (Level 3)
Total Time
15 * 2 - 30 HRS

Time Duration

2
2
2
2
2
2

2
2

2
2

2
2

2
2
2

2
2
2

You might also like