Periods/Week
Course Code Course Title Semester Category C
L T P S
ECA1205 Java Programming III ES 2 0 4 4 4
Theory
Variable Declaration, Course
Pre-requisite cum Learning Level BTL4
Inheritance Type
Project
Course Objectives:
To Internalize OOPs concepts and integrate Java Mechanisms in building Real-Time Applications.
Course Outcomes:
Upon completion of the course, the students will be able to:
CO Course Outcomes
CO1 Capture various Object-Oriented Programming concepts and Java paradigms.
CO2 Describe the structure and various mechanisms of the Java programming language.
CO3 Demonstrate the principles of Packages, Exception Handling and Multithreading.
CO4 Construct java application with various Collection Framework and I/O Streams.
CO5 Integrate the knowledge of Java syntax, libraries, and frameworks in building applications.
Syllabus
Module I Introduction to OOPs and Java Paradigms 9+6
Object Oriented Programming concepts-Evolution of Java-Java Components-Datatypes, Variables and
Operators-Branching and Control Statements-Arrays and Strings.
Self Study Topics
Type conversion and casting, Recursion
Case Study Problems
a. Program to reverse a string in Java
b. Program to convert the int value to float value and vice versa.
c. Program to check if the given number is a prime number.
d. Program to sort an array in Java.
e. Program to find maximum of three numbers.
f. Program to evaluate a mathematical expression given in string format without using inbuilt eval ()
function. For example, input would be a string variable of the form 5*10/20+6 and your program
should output the result. The challenge here is first you have the input in string format and secondly
you got to follow the BODMAS rules.
Module II Object Oriented Mechanism in Java 9+6
Classes and Objects-Methods- Constructors- Inheritance-Interfaces –Polymorphism.
Self Study Topics
Final classes and Methods, Abstract classes and Methods
Case Study Problems
a. Java program to print whether the given number is even or odd.
b. How do you show a diamond problem with multiple inheritance in Java?
c. Can we override the private method and final method in Java?
d. Program to print different kind of patterns like Triangular pattern, box pattern, Pyramid patter of stars,
numbers or alphabets
e. Write an interface with default and static method?
f. Can the main method be Overloaded?
g. Write a method which takes a string str as parameter and returns true if it equals to "Hello World",
false otherwise.
h. Program to demonstrate implementation of Singleton pattern using private constructors.
i. Program to demonstrate Interface to calculate area and perimeter of circle.
Module III Packages, Exception Handling and Multithreading 9+6
Packages- Creating & Accessing a Package – Adding Class to a Package-Exception Handling- Types of Errors
– Mechanisms of Exception Handling and Multithreading.
Self Study Topics
Creating Own Exception, Thread Priorities
Case Study Problems
a. A single try block and multiple catch blocks can co-exist in a Java Program. Explain.
b. Java program that implements a multi-thread application that has three
threads. First thread generates random integer every 1 second and if the value is even,
second thread computes the square of the number and prints. If the value is odd, the third
thread will print the value of cube of the number.
c. Following are the cases when this keyword can be used:
Accessing data members of parent class when the member names of the class and its child
subclasses are same.
To call the default and parameterized constructor of the parent class inside the child class.
Accessing the parent class methods when the child classes have overridden them.
To demonstrates all 3 cases when a super keyword is used.
d. Java program to create and throw custom exceptions.
e. Write a Java program to perform employee payroll processing using packages. In the java file,
[Link] creates a package employee and creates a class Emp. Declare the variables name,empid,
category, bpay, hra, da, npay, pf, grosspay, incometax, and allowance. Calculate the values in
methods. Create another java file [Link]. Create an object e to call the methods to perform and
print values.
f. Write a Java program to perform a runnable interface, take two threads t1 and t2 and fetch the names
of the thread using getName() method.
g. Write a java program using multiple catch blocks. Create a class CatchExercise inside the try block
declare an array a[] and initialize with value a[5] =30/5. In each catch block show Arithmetic exception
and ArrayIndexOutOfBoundsException.
Module
I/O Streams and Collections 9+6
IV
I/O Streams-Reading and Writing: Console and Files- Collections: Array List, Tree, Set, Map, Stack and Queue.
Self Study Topics
Database Connectivity, Collection Framework.
Case Study Problems
a. Write a program that reads from the user four integers representing the numerators and denominators
of two fractions calculates the results of the two fractions and displays the values of the fractions sum,
subtraction, multiplication and division.
b. What is the error in code to sort date in ascending order using collection.
Suppose that a table named [Link] is stored in a text file. The first line in the file
header and the remaining lines correspond to row in the table. The elements are separated
by commas. Write a Java program to display the table.
c. Java program that loads names and phone numbers from a text file where the
data is organized as one line per record and each field in a record are separated by a tab
(\t).it takes a name or phone number as input and prints the corresponding other value from
14 the hash table(hint: use hash tables)
d. Implement the above program with database instead of a text file.
e. Write a Java program to Create a file [Link] and perform getName(), getAbsolutePath(),
canWrite(), canRead() methods to get information about the file.
Module V Project Specimen 15
1. Creating a Calculator.
2. Simple Banking Application.
3. Producer-Consumer Problem.
Total Hours 75
Learning Resources:
Text Books
1 Herbert Schildt,”Java: The Complete Reference “,| 12th Edition ,December 2022.
Core Java, Vol. II-Advanced Features, 12th Edition, by Cay S. Horstmann, Released April 2022
2
Publisher(s): Oracle Press ISBN: 9780137870899
Reference Books
1 Paul Deitel,Harvey Deitel,”Java SE 8 for programmers”,3rd Edition,Pearson,2022.
2 Steven Holzner,”Java 2 Black book”,Dreamtech press,2022.
3 Timothy Budd,”Understanding Objectoriented programming with Java”,Updated Edition.2022.