Core Java
Core Java
Description
This course focuses on the basics of Object-oriented programming system with Java and core
technologies that are implemented for developing distributed and enterprise applications in Java. This
includes an introduction to Java Database Connectivity (JDBC) API databases, and moves on to the
advance features of JDBC.
The course provides an introduction to object-oriented concepts and its implementation in Java
technology programs. It covers the programming concepts and principles such as encapsulation,
abstraction, inheritance, interfaces, polymorphism, and object association. This course also covers the
fundamentals of Java programming language such as variables, literals, access specifiers, and modifiers.
The course also explains how to handle the exceptions in Java using the try and catch statement. This
course also deals with the concept of applets, swings, and AWT components. It also deals with threads,
garbage collection, and binary I/O stream classes.
Towards the end, the course covers JDBC and deals with accessing and querying a database using JDBC
and how to perform transaction management, batch updates, and retrieval of metadata information
using JDBC.
Finally, the course covers the concepts and notations related to the Unified Modeling Language.
Rationale
Java is an object-oriented language that enables you to create real world applications. The code
reusability feature of Java enables the software developers to upgrade the existing applications without
rewriting the entire code of the application.
Applets and Swings in Java enable you to create web-based applications. The Layout manager in Java
enables a software developer to apply various types of border layout to the Web application. The concept
of Multithreading enables the developer to build programs that use multiple system resources
simultaneously.
The concept of working with files and I/O streams enables the software developers to store and retrieve
the information from a flat or a text file. Packages enable the reusability of classes and methods across
various applications.
Component technologies, such as JavaBeans, servlets, and JSP use the service and communication
technologies for implementing the functionality of enterprise applications.
JDBC is a service technology that provides database-independent connectivity between Java applications
and different databases.
Unified Modeling Language (UML) is a notation that allows the modeler to specify, visualize, and
construct the artifacts of software systems, as well as business models.
Entry Profile
The students wanting to undergo this course are recommended to have the following skills:
Exit Profile
After completing this module, the student should be able to:
Introduction
Create robust Java applications using exception handling, generic collections and concurrency
control
Course Objectives
After completing this sub-module, students will be able to:
Introduction
Session
Sections
(6 Hrs)
(2 Hrs)
(40 Min)
Topics
Duration
(In Min)
Cycle 1
CR 1
Lesson 1A
Section 1
Section 2
Section 3
CR 2
Objectives
10
15
15
Total
40
20
20
Total
40
30
Summary
10
Total
40
Lesson 1B
Section 1
Section 2
Section 3
Pre-assessment
Questions
10
Objectives
10
Encapsulation
30
Total
40
Abstraction
15
Inheritance
25
Total
40
Polymorphism
30
Introduction
Cycle
Session
Sections
(6 Hrs)
(2 Hrs)
(40 Min)
Collaborate
Topics
Duration
(In Min)
Summary
10
Total
40
Lesson 1C
Section 1
Section 2
Experiment
Object-Oriented Analysis
and Design
SPL
Various Types of
Inheritance
SPL
SPL
FAQs
SPL
Challenge
SPL
Lesson 1D
Section 1
Exercises
120
Total
120
Cycle 2
CR 1
Lesson 2A
Section 1
Section 2
Section 3
CR 2
10
Objectives
10
20
Total
40
40
Total
40
Arrays
30
Summary
10
Total
40
Lesson 2B
Section 1
Pre-assessment
Questions
Pre-assessment
Questions
10
Objectives
Structure of a Java
program
15
Introduction
Cycle
Session
Sections
(6 Hrs)
(2 Hrs)
(40 Min)
Section 2
Section 3
Collaborate
Topics
Duration
(In Min)
Total
40
40
Total
40
Creating a Java
application
20
Problem Statement
10
Summary
10
Total
40
Lesson 2C
Section 1
Section 2
Experiment
SPL
Garbage Collection in
Java Virtual Machine
(JVM)
SPL
SPL
SPL
Best Practice
SPL
SPL
FAQs
SPL
Challenge
SPL
Lesson 2D
Section 1
Exercises
120
Total
120
SL-275
CR
CR 1
Lesson / Topics
Dura
tion
Slide
#
Objectives
35
5
8
Garbage Collection
11
12
Introduction
CR
Lesson / Topics
Operation of the JRE With a
Just-In-Time (JIT) Compiler
JVM Tasks
Dura
tion
15
16
17
18
19
14
20
40
21
Runtime Errors
22
Slide
#
13
23
Objectives
Software Engineering
The Analysis and Design Phase
Abstraction
Classes as Blueprints for
Objects
Declaring Java Technology
Classes
4
20
7
5
Declaring Attributes
5
6
7
8
117
CR 2
2: Object-Oriented
Programming
10
Declaring Methods
Accessing Object Members
Information Hiding
20
Encapsulation
10
12-13
15
16
10
17
10
18
19
20
21
12
Development
Compiling Using the -d Option
Terminology Recap
22
23
24
25
26
5
Objectives
2
5
Comments
11
14
Declaring Constructors
3: Identifiers,
Keywords, and
Types
Introduction
CR
Lesson / Topics
Semicolons, Blocks, and White
Space
Dura
tion
10
5
Identifiers
Java Programming Language
Keywords
Slide
#
6-8
9
10
100
1: Getting Started
MR
1
2: Object-Oriented
Programming
Lab
Exercise 1
10
Exercise 2
15
Lab
Exercise 1
15
Exercise 2
30
Exercise 3
30
Exercise 4
15
120
3: Identifiers,
Keywords, and
Types
11
Logical boolean
12
25
Textual char
Textual String
Integral byte, short, int, and
long
Floating Point float and
double
Variables, Declarations, and
Assignments
14
15-16
17-18
8
5
13
19
20
21
15
22
23
24
Assigning a Variable
25
5
Assigning References
26
20
Pass-by-Value
27-31
15
32-34
10
Objectives
5
6
7
8
114
CR 4
4: Expressions and
Flow Control
Operators
20
Operator Precedence
Introduction
CR
Lesson / Topics
Dura
tion
Logical Operators
Slide
#
10
11
12
13
14
15
Casting
Promotion and Casting of
Expressions
16
17
Branching Statements
Simple if, else Statements
Complex if, else Statements
20
Switch Statements
21-23
Looping Statements
24-26
18
19-20
27
30
28
29
30
31
Objectives
Declaring Arrays
Creating Arrays
15
5-6
Multidimensional Arrays
7-8
6
Initializing Arrays
Array Bounds
10-11
12
6
Using the Enhanced for Loop
13
Array Resizing
14
8
Copying Arrays
15
120
MR
2
3: Identifiers,
Keywords, and
Types
4: Expressions and
Flow Control
Lab
Exercise 1
30
Exercise 2
30
Lab
Exercise 1
15
Exercise 2
30
Exercise 3
5: Arrays
Additional Exercise
Lab
Exercise 1
15
Introduction
CR
Lesson / Topics
Exercise 2
Dura
tion
Slide
#
120
6: Class Design
Objectives
Subclassing
15
Single Inheritance
Access Control
Overriding Methods
Overridden Methods Cannot Be
Less Accessible
20
7
9
12
13-14
Polymorphism
15-16
15
18
Polymorphic Arguments
19
Casting Objects
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
15
10
17
Heterogeneous Collections
The instanceof Operator
10-11
CR 5
2
4-6
20
21-22
23
24
20
25-26
27
28-29
15
30
31-32
120
CR 6
6: Class Design
34
35
30
36-39
40
10
Objectives
41
42
Class Attributes
5-6
10-11
20
Class Methods
Static Initializers
The final Keyword
10
Final Classes
12
Final Methods
Final Variables
13
Introduction
CR
Lesson / Topics
Dura
tion
Slide
#
14
Enumerated Types
Old-Style Enumerated Type
Idiom
15-18
19-22
23-24
35
10
Static Imports
25-26
120
6: Class Design
MR
3
Lab
Exercise 1
45
Exercise 2
50
Exercise 3
Additional Exercise
95
7: Advanced Class
Features
Abstract Classes
20
The Solution
31-33
Interfaces
20
44
5
Objectives
Exceptions and Assertions
Exceptions
5
15
Exception Example
The try-catch Statement
Call Stack Mechanism
2
4
10
5
6
7-9
10
11
Exception Categories
12
Common Exceptions
13
5
5
15
Internal Invariants
Control Flow Invariants
Postconditions and Class
Invariants
Controlling Runtime Evaluation
of Assertions
15-16
17-18
20
21
10
22
23
24
25
120
Introduction
14
18
Assertions
Recommended Uses of
Assertions
10
35-41
42-43
Uses of Interfaces
CR 7
34
8: Exceptions and
Assertions
27-30
CR
Lesson / Topics
Dura
tion
5
Objectives
System Properties
10
Console I/O
Command-Line Arguments
7-9
10
11
20
12-13
14
15
16
17
18-19
CR 8
Slide
#
30
20
21-22
23-24
25-26
A Set Example
27
20
A List Example
Collections in JDK Version 1.1
Generics
28
39
30
15
Compiler Warnings
31
32
Iterators
33
10
34
35
120
7: Advanced Class
Features
MR
4
Lab
Exercise 1
30
Exercise 2
30
8: Exceptions and
Assertions
Lab
9: Text-Based
Applications
Lab
Exercise 1
30
Exercise 1
Additional Exercise
Exercise 2
30
120
CR 9
Objectives
Containers
Positioning Components
Frames
6
7
15
Introduction
11
CR
Lesson / Topics
Dura
tion
Slide
#
9
Example Frame
10
Panels
The FrameWithPanel Class
15
Layout Managers
11-12
13
15
16
17-18
20
21-23
45
24
26-27
Example of BorderLayout
28
30-31
Example of GridLayout
32
Drawing in AWT
Various Shapes Drawn by the
Graphics Object
29
10
5
33-35
36
37
115
CR
10
Objectives
What Is an Event?
20
7-8
GUI Behavior
Event Categories
Method Categories and
Interfaces
9-10
30
Complex Example
13-16
Multiple Listeners
17
18
20
AWT Components
10
AWT Listeners
How to Create a Menu
Creating a MenuItem
12
Introduction
4
7-8
10
20
Creating a CheckBoxMenuItem
Controlling Visual Aspects
Creating a MenuBar
Creating a Menu
21
5
Objectives
19-20
11-12
13-14
15
17
CR
Lesson / Topics
Dura
tion
Slide
#
18
J.F.C./Swing Technology
125
10: Building Java
GUIs
Lab
Exercise 1
40
Exercise 2
MR
5
Additional Exercise
Lab
Exercise 1
35
Exercise 2
12: GUI-Based
Applications
Additional Exercise
Lab
Exercise 1
35
110
13: Threads
Objectives
Threads
5-6
7
25
Thread Scheduling
Thread Scheduling Example
10-11
10
10
12
13
14
16
17-19
20
20
21-22
23
24
Discuss the problem and the
solution
10
26
10
27
28
29
31
33
10
15
8
9
Terminating a Thread
Basic Control of Threads
CR
11
34
35
10
Introduction
36-37
13
CR
Lesson / Topics
Dura
tion
Slide
#
120
14: Advanced I/O
Streams
Objectives
I/O Fundamentals
2
4
Byte Streams
The InputStream Methods
7
20
Character Streams
The Reader Methods
CR
12
10
A Simple Example
15: Networking
10
5
Node Streams
12
Buffered Streams
14
16
Processing Streams
17
19
21
22
Objectives
Networking
Networking With Java
Technology
20
2
4-5
10
11
6
7
15
10
119
MR
6
13: Threads
Lab
15: Networking
Lab
Exercise 1
60
Exercise 1
50
110
14
Introduction
JDBC
Cycle
Session
Sections
(6 Hrs)
(2 Hrs)
(40 Min)
Topics
Duration
(In Min)
Cycle 1
CR 1
Lesson 1A
Section 1
Section 2
Section 3
CR 2
Objectives
JDBC Architecture
10
JDBC Drivers
15
Loading a Driver
10
Total
40
Connecting to a Database
20
10
Total
40
Methods of ResultSet
Interface
10
Problem Statement
25
Summary
Total
40
Lesson 1B
Section 1
Pre-assessment
Questions
Objectives
Methods of the
PreparedStatement
Interface
12
Retrieving Rows
Inserting Rows
Problem Statement
10
Introduction
15
Cycle
Session
Sections
(6 Hrs)
(2 Hrs)
(40 Min)
Section 2
Section 3
Collaborate
Duration
(In Min)
Total
40
Committing a Transaction
10
Implementing batch
Updates in JDBC
10
Exception handling in
Batch Updates
Creating an Application to
Insert Rows in a Table
Using Batch Updates
Total
40
Calling a Stored
Procedure without
Parameters
Calling a Stored
Procedure with
Parameters
10
Using DatabaseMetaData
Interface
Using ResultSetMetaData
Interface
Problem Statement
Summary
Total
40
Lesson 1C
Section 1
Section 2
Experiment
SPL
JDBC API
SPL
Isolation Levels
SPL
Best Practices
SPL
FAQs
SPL
Challenge
SPL
Lesson 1D
Section 1
16
Topics
Exercises
120
Total
120
Introduction
UML
Cycle #
Activity/Problem No.
Duration (In
Mins)
Cycle1
CR1
Lesson 1: Objectives
Object-Oriented Approach
10
An Introduction to UML
10
Architecture
10
User View
10
10
10
Structural View
20
15
10
Summary
Total
120
Lesson 2: Objectives
15
15
10
10
10
CR2
Introduction
17
Cycle #
Activity/Problem No.
Duration (In
Mins)
10
Summary
10
Total
85
All Practice exercise of UML module are not part of the session plan hence, students
have to cover it as self-learning.
SPL sessions indicate Self Paced Learning. The students are provided material for
self learning on the course through sessions known as Self Paced Learning or
Collaborate.
The students are supposed to study the content of the Collaborate sessions at their
own pace.
The Faculty has to conduct all Practice exercises in either one of the following
ways:
18
Ask the students to read the steps and call any one student randomly to
perform the steps on faculty node.
After demonstration, let students write the solution to the practice and then
call any student to perform the activity on Faculty node.
A written test can be taken for the steps or solution of various exercises and
students can check each others solutions
Ask the students to solve the exercise in a group mode and then one student
from different groups can come up and solve different parts of the exercise
on the whiteboard or the faculty node.
Introduction
MILESTONE
Week
#
CR
CR
MR
1
2
Java Fundamentals\lesson 1A
Java Fundamentals\lesson 2A
Java Fundamentals\lesson 1B
Java Fundamentals\lesson 2B
7
8
9
10
11
Java Fundamentals\lesson 1D
Java Fundamentals\lesson 2D
Java Programming Language1&2
Java Programming Language3&4
Java Programming Language5&6
Java Programming Language7&8
Java Programming Language9 & 10
Java Programming Language11 & 12
JDBC- Lesson 1D
MT
Project
12
Project
Project
Project
Introduction
19
TYPE
MR
CR
Number of
Machines
1.1
Faculty Node
1.2
Student Nodes
<Depends on the
machine room setup>
<Depends on the
class room setup>
H/w Configuration
2.1
Faculty Node
processor (2 GHz or
higher), SCSI
processor (2 GHz or
higher), SCSI
512MB RAM,
512MB RAM,
CDROM and
CDROM and
2-10/100 Mbps
2-10/100 Mbps
network cards.
network cards.
processor (2 GHz or
higher), SCSI
processor (2 GHz or
higher), SCSI
512MB RAM,
512MB RAM,
CDROM and
CDROM and
1-10/100 Mbps
1-10/100 Mbps
network card.
network card.
NA
NA
Microsoft Windows XP
Professional with Service
Pack (SP) 2 or later or
Microsoft Windows Server
2003 (or higher) with IIS
configured, Microsoft
PowerPoint (to run the slide
shows), JDK Version 1.5.0,
NetBeans 5.5.1
Microsoft Windows XP
Professional with
Service Pack (SP) 2 or
later or Microsoft
Windows Server 2003
(or higher) with IIS
configured, Microsoft
PowerPoint (to run the
slide shows), JDK
Version 1.5.0,
NetBeans 5.5.1
2.2
20
Student Nodes
2.3
Printer
S/w Configuration
3.1
Faculty Node
Introduction
TYPE
MR
CR
3.2
Student Nodes
Windows XP,
Windows XP,
NetBeans 5.5.1
NetBeans 5.5.1
Introduction
21
IMPLEMENTATION MANUAL
Installing SQL Server 2000 Enterprise Edition Database
Server
To install SQL Server 2000 Enterprise Edition Database Server, perform the following steps:
1. Insert the SQL Server 2000 CD in the CD-ROM.
2. Select SQL Server 2000 Components from the list of displayed options.
3. Select the Install Database Server option.
4. Click Next on the Welcome Page.
5. Select Local Computer to install SQL Server and click the Next button.
6. In the Installation Option window, select Create a new instance of SQL Server or Install
Client Tools and click the Next button.
7. Enter the user information and click the Next button.
8. This will display the Software License Agreement window. Click the Yes button to accept the
agreement.
9. After entering the CD Key, click the Yes button.
10. In this window, select Server and Client Tools and click Next.
11. In the Instance Name window, type the name of the SQL Server and click the Next button.
12. In the Setup Type window, select Custom Installation.
13. Select the appropriate folders for Program Files and Data Files on the disk having enough
space and click the Next button.
14. Accept the default selections for server and client components and click the Next button.
15. In the Services Accounts window, select Use the same account for each service option.
16. Select the Auto Start SQL Service option.
17. In the Service Settings pane, enter the domain user and password.
18. Click the Next button.
19. In Authentication Mode, select the Mixed Mode (Windows Authentication and SQL Sever
Authentication) option and type the password for sa.
20. Click the Next button.
21. Click the Next button in the Collation Settings window.
22. In the Network Libraries window, select the Named Pipes and TCP/IP Sockets options.
23. Click the Next button.
24. In the Start Copying Files window, click the Next button.
25. In the Choose Licensing Mode window, select Per Seat For and specify the number of users
who can connect to SQL Server at a given time.
26. Click the Continue button.
27. Click the Finish button in the Setup Complete window.
22
Introduction
1.
3.
4.
5.
The License Agreement section appears in the J2SE Development Kit 5.0 Update 6-Licence dialog
box.
2.
Introduction
23
24
6.
Select the I accept the terms in the license agreement radio button, as shown in the following
figure.
7.
Click the Next button. The Custom Setup section appears in the J2SE Development Kit 5.0
Update 6-Licence dialog box, as shown in the following figure.
8.
Introduction
9.
Click the Next button. The Custom Setup section appears in the J2SE Development Kit 5.0
Update 6-Licence dialog box, as shown in the following figure.
10. Click the Next button. The Browser Registration section appears in the J2SE Development Kit 5.0
Update 6-Licence dialog box.
11. Select the Microsoft Internet Explorer check box.
Introduction
25
26
Introduction
2.
Click the Run button to display the Welcome to the Install Wizard for NetBeans IDE 5.5.1 and
Sun Java System Application Server Platform Edition 9.0 Update 1 page, as shown in the
following figure.
3.
Click the Next button to display the license agreement page, as shown in the following figure.
Introduction
27
28
4.
Select the I accept the terms in the license agreement option and click the Next button to display
the following figure.
5.
6.
Introduction
7.
Click the Next button to start copying the files required to install NetBeans 5.5.1. After the
installation is complete, the NetBeans IDE 5.5.1 and Sun Java System Application Server 9.0
Update 1 Installer window is displayed, as shown in the following figure.
8.
Introduction
29
SCHEMAS
30
Introduction
SCRIPTS
Scripts
Description
CreateServerLogins.bat
INSTALLDACJ_DEMO.BAT
INSTALLDACJ_MR.BAT
INSTALL_Employee.BAT
Before every CR and lab session, the faculty needs to drop the database and restore the backed up
copy using the Enterprise Manager of Microsoft SQL Server.
Note: You can also reinstall the database but it takes less time to restore a database than to install
it.
The scripts INSTALLDACJ_DEMO.BAT and INSTALLDACJ_MR.BAT have to be executed before
conducting the first session of Introducing JDBC of JDBC and JavaBeans domain. You can run the
INSTALL_Employee.BAT before you conduct the session on a Project.
Introduction
31
32
Introduction