0% found this document useful (0 votes)
3 views33 pages

24ebcc205 Java

The document outlines the course plan for Java Programming (Course Code: 24EBCC205) for the 4th semester of the 2024-25 academic year, detailing prerequisites, course outcomes, competencies, and performance indicators. It includes a structured lesson plan authored by multiple professors and emphasizes the application of object-oriented programming concepts, exception handling, and multithreading. The course aims to equip students with the skills needed to design and implement real-world applications using Java.

Uploaded by

maktumgudubhai84
Copyright
© All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
3 views33 pages

24ebcc205 Java

The document outlines the course plan for Java Programming (Course Code: 24EBCC205) for the 4th semester of the 2024-25 academic year, detailing prerequisites, course outcomes, competencies, and performance indicators. It includes a structured lesson plan authored by multiple professors and emphasizes the application of object-oriented programming concepts, exception handling, and multithreading. The course aims to equip students with the skills needed to design and implement real-world applications using Java.

Uploaded by

maktumgudubhai84
Copyright
© All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd

DEPARTMENT OF COMPUTER APPLICATIONS

FMTH0301/Rev.5.3
Course Plan
Semester: 4 Semester Year: 2024-25

Course Title: Java Programming Course Code: 24EBCC205

Total Contact Hours: 50 Duration of ESA: 3 hours

ISA Marks: 50 ESA Marks: 50


Lesson Plan Author: Prof Roopa Badami
Prof. Sanju S Date: 28-02-2025
Prof Vijayalaxmi V
Checked By: Prof Shashikala Budni Date: 28-02-2025

Prerequisites: Knowledge of C and C++ programming

Course Outcomes (COs):


At the end of the course, the student should be able to:

1. Explain the platform-independent programming language and object-oriented


concepts.
2. Apply exception handling, Interfaces and Inheritance multithreaded concepts to
implement a given scenario.
3. Design and implement real-world applications using object-oriented principles of
java language.

1
DEPARTMENT OF COMPUTER APPLICATIONS

Course Articulation Matrix: Mapping of Course Outcomes (COs) with Program


Outcomes (POs)
Course Title: Java Programming Semester: 4
Course Code: 24EBCC205 Year: 2024-25

Course Outcomes (COs) / 1 2 3 4 5 6 7 8 9 10 11 12 13 14


Program Outcomes (POs)
1. Explain the platform- L M M
independent
programming language
and object-oriented
concepts.

2. Apply exception H M M
handling, Interfaces
and Inheritance
multithreaded concepts
to implement a given
scenario.

3. Design and implement H M M


real-world applications
using object-oriented
principles of java
language.

Competency addressed in the Course and corresponding Performance Indicators

Competency: 1.1 Demonstrate the competence in mathematical modeling.


PI Code: 1.1.1 Apply mathematical techniques to modeling and problem solving
Competency: 1.3 Demonstrate competence in computing fundamentals
PI Code: 1.3.1 Apply elements of computer science principles and laws
Competency: 1.4 Demonstrate competence in computing knowledge
PI Code:1.4.1 1.4.1 Apply software engineering principles to solve computing
problems.
Competency: 2.2 Demonstrate an ability to formulate a solution plan and methodology
for a computing problem
PI Code: 2.2.2 Describe requirements of all the components of the problem and
formulate the solution plan.
Competency: 2.4 Demonstrate an ability to execute a solution process and analyze
results.

2
DEPARTMENT OF COMPUTER APPLICATIONS

PI Code: 2.4.2 Produces and validates results through skillful use of contemporary
computing tools and models.
Competency: 3.1 3.1 Demonstrate an ability to define a complex open-ended problem in
computing terms.
PI Code:3.1.1 3.1.1: Realize the necessity of good problem statements in the
design/development of solutions.
Competency: 3.2 Demonstrate an ability to generate a diverse set of alternative design
solutions
PI Code: 3.2.2 Build models, prototypes, etc., to develop diverse set of design
solutions.
Competency: 3.3 3.3 Demonstrate an ability to select the optimal design scheme for
further development.
PI Code:3.3.1 3.3.1 Apply formal multi-criteria decision-making tools to select
optimal computing design solutions.
Competency: 5.1 5.1Demonstrate an ability to identify/ create modern computing
tools, techniques and resources
PI Code: 5.1.1 5.1.1Identify modern computing tools, techniques and resources for
computing activities
Competency: 5.2 Select and apply domain-specific tools, techniques, and resources
PI Code:5.2.2 Demonstrate proficiency in using domain-specific tools
Competency: 7.1 Demonstrate an ability to identify gaps in knowledge and a strategy
to close these gaps
PI Code:7.1.2 Identify deficiencies or gaps in knowledge and demonstrate an ability
to source information to close this gap.
Competency: 13.1 Demonstrate computing skills relevant to application domain.
13.1
PI Code:13.1.1
Ability to design, develop software systems by considering
requirements, performance, integrity and security aspects of different
domains.
Eg: 1.2.3: Represents program outcome ‘1’, competency ‘2’ and performance indicator ‘3’.

3
DEPARTMENT OF COMPUTER APPLICATIONS

Chapter 1: Introduction

Topics/Concepts: Java Fundamentals and Java Development Kit


Course Outcome 1 -: Explain the platform-independent programming language and
object-oriented concepts.
Competency Performance Breaking Down at Course Specific
Indicators Concept Level performance indicators
(PIs) (CSPIs)

1.3 1.3.1 Apply Understanding Java's


Demonstrate fundamental  Explain the history of history, fundamentals,
competence in s of computer java, fundamentals and platform independence,
features
computing science to and object-oriented
 Explain the platform-
fundamentals solve independent programming concepts
computing and object-oriented
problems. concepts.
1.4 1.4.1 Apply  Define the modularity, Apply object-oriented
Demonstrate software reusability, concepts like
competence in engineering maintainability, and encapsulation,
scalability in Java
computing principles to inheritance,
programs.
knowledge solve  Application of abstraction, polymorphism, and
computing encapsulation, abstraction to design
problems. inheritance, and reusable, maintainable,
polymorphism to solve and scalable software.
real-world problems.
5.2: Select and 5.2.2  Use Java Development Use Java Development Kit
apply domain- Demonstrate Kit (JDK) and Java (JDK) to write program
specific tools, proficiency in Development Environment with proper
for implementation.
techniques, using documentation and coding
 Debugging and Analyzing
and resources domain- Execution Results conventions and compile,
specific tools- debug and run programs.

4
DEPARTMENT OF COMPUTER APPLICATIONS

Chapter 2: Introducing Classes, Objects, and Methods

Topics: Classes, Objects, Methods and constructors


Course Outcome - 1: Explain the platform-independent programming language and
object-oriented concepts.
Competency Performance Breaking Down at Course Specific
Indicators Concept Level performance
(PIs) indicators (CSPIs)
1.3 1.3.1 Apply  Write as program using Use OOPS concepts to
Demonstrate fundamentals of OOPS concepts by promote modularity,
competence in computer science decomposing complex reusability, protect
systems into objects to data using
computing to solve
promote modularity, encapsulation and
fundamentals computing reusability, and easier abstraction to hide the
problems. problem-solving. implementation in
 Use encapsulation to solving real-world
bundle data and problems.
methods within objects
for protecting internal
details, and abstraction
to hide complex
implementation details.
2.2Demonstrat 2.2.1Decompose  Use access modifiers, Apply method
e an ability to complex problem method overloading overloading for
formulate a into concept to have readability,
flexibility in code and constructors for
solution plan interconnected
use access modifiers to initialization, and
and sub-problems. share and protect the access modifiers for
methodology data. encapsulation to
for a design optimized
computing programs.
problem

5
DEPARTMENT OF COMPUTER APPLICATIONS

Chapter 3 Inheritance

Topics: Inheritance, Significance of Access specifiers, Method Overriding, Abstract


methods

Course Outcome -2: Apply exception handling, Interfaces and Inheritance


multithreaded concepts to implement a given scenario.
Competency Performance Breaking Down at Concept Course Specific
Indicators Level performance
(PIs) indicators (CSPIs)
3.2Demonstrat .3.2.1 Apply  Design and implement Develop strategies
e an ability to formal idea classes using the to decompose
generate a generation tools principles of complex problems
inheritance, focusing on into smaller, well-
diverse set of to develop
decomposing complex defined classes,
alternative multiple problems into smaller, making design and
design computing design manageable implementation
solutions. solutions. components to simplify more manageable
design and and efficient.
development.

3.3 3.3.1 Apply  Design and implement Use polymorphism


Demonstrate formal multi- method overloading and and abstract classes
an ability to criteria decision- method overriding using to implement
polymorphism and method overloading
select the making tools to
abstract classes to and overriding,
optimal design select optimal improve flexibility and creating flexible and
scheme for computing design reusability. reusable software.
further solutions.  Focus on clear, efficient,
development. and scalable design for
optimal software
development.
13.1 13.1.1  Write programs using Design programs
Demonstrate Ability to design, the final keyword with using the final
computing develop software Data members and keyword with data
Object class members to enforce
skills relevant systems by
immutability and the
to application considering Object class to
domain. requirements, leverage built-in
performance, methods
integrity and
security aspects
of different
domains.

6
DEPARTMENT OF COMPUTER APPLICATIONS

Chapter 4: Packages and Interfaces

Topics: Working with Packages, Significance of access specifiers, Interfaces and


static members
Course Outcome-2: - Apply exception handling, Interfaces and Inheritance
multithreaded concepts to implement a given scenario

Competency PI Breaking Down at Course Specific


Concept Level performance indicators
(CSPIs)

3.1 3.1.1: Realize the  Understanding of Apply modular design


Demonstrate necessity of good built-in and user- principles by designing
an ability to problem defined packages, and implementing
explore package
define a statements in the packages and interfaces
member access and
complex design/developmen interfaces, and apply to organize code,
open-ended t of solutions. modular design promote reusability, and
problem in principles to enhance maintainability.
computing structure code
terms. efficiently and
maintainable.
13.1 13.1.1 Understanding of
Demonstrate Ability to design,  Identify the multiple inheritance
computing develop software challenges of challenges and
multiple inheritance
skills systems by effectively implement
and understand the
relevant to considering use of static and static and private
application requirements, private methods methods within
domain. performance, within interfaces. interfaces to design
integrity and flexible and
security aspects of maintainable software
different domains. systems.

7
DEPARTMENT OF COMPUTER APPLICATIONS

Chapter 5: Exception Handling

Topics: Exception Fundamentals, try, catch, throw blocks, Throwing and Re-
throwing Exception, Exception subclasses.
Course Outcome- 02 Apply exception handling, Interfaces and Inheritance
multithreaded concepts to implement a given scenario .

Competency PI Breaking Down at Course Specific


Concept Level performance indicators
(CSPIs)

3.1 Realize 3.1.1: Identify  Explain the exception Apply exception


the necessity situations handling in Java to handling for building
of good requiring effectively manage applications that work
runtime errors and well and handle errors
problem exception
unexpected situations. without crashing.
statement in handling,  Emphasize professional
the including error handling by
design/devel uncaught writing clean,
opment of exceptions, and organized, and efficient
solutions. take appropriate code to ensure robust
action. and reliable software.
5.1Demonstr 5.1.1Identify  Explain the exception Understand the
ate an ability modern hierarchy and exception hierarchy by
to identify/ computing tools, implement try and differentiating between
catch blocks, while checked and unchecked
create techniques and
recognizing the impact exceptions and exploring
modern resources for of uncaught runtime the roles of the
computing computing exceptions that can Throwable, Error, and
tools, activities cause program Exception classes.
techniques termination. Analyse uncaught
and runtime exceptions by
resources interpreting error
messages and tracing
stack traces.

13.1 13.1.1  Analyse the concepts of Use the throw and


Demonstrate Ability to design, throwing and throws keywords to
computing develop software rethrowing exceptions, implement throwing and
demonstrate the use of rethrowing exceptions,
skills relevant systems by
built-in exceptions. helping to signal and
to application considering  Create custom manage errors. Apply
domain. requirements, exception subclasses to built-in exceptions like
performance, handle specific error Arithmetic Exception,
integrity and scenarios effectively. NullPointerException,
security aspects and Exception to handle

8
DEPARTMENT OF COMPUTER APPLICATIONS

of different common runtime errors


domains. effectively.

Chapter 6: Multithread Programming

Topics: Multithreading Fundamentals and Synchronization


Course Outcome-2: Apply exception handling, Interfaces and Inheritance
multithreaded concepts to implement a given scenario.

Competency PI Breaking Down at Concept Course Specific


Level performance
indicators (CSPIs)
3.1Demonstrat 3.1.1 Realize the  Explain the benefits and Explain how threading
e an ability to necessity of a challenges of threading, improves program
define a good problem identify critical sections, performance,
and analyse potential
complex open- statement in the responsiveness, and
threading issues.
ended problem design/develop resource usage. Design
in computing ment of thread-safe programs by
terms. solutions. minimizing critical
sections and using
proper concurrency
controls.

5.1Demonstrat 5.1.1Identify  Explain the Thread class Compare the Thread


e an ability to modern and Runnable interface, class and Runnable
identify/ computing and create multiple interface to determine
threads to enable
create modern tools, the most suitable
concurrent task
computing techniques and execution, enhancing method for creating
tools, resources for program efficiency. threads. Control thread
techniques computing  Describe thread execution order and
and resources activities priorities and how to importance by
control thread execution managing priorities with
order using the the setPriority () and
setPriority () and get
getPriority () methods.
Priority () methods.

13.1 13.1.1  Implement Use synchronization to


Demonstrate Ability to synchronization to manage thread access to
computing design, develop control access to shared shared resources,
resources and prevent
skills relevant software preventing conflicts and
race conditions. Explain
to application systems by inter-thread ensuring data integrity.
domain. considering communication using Implement inter-thread
requirements, wait (), notify (), and communication with
performance, notifyAll () methods to wait (), notify (), and
integrity and avoid deadlocks and notifyAll () to coordinate

9
DEPARTMENT OF COMPUTER APPLICATIONS

security aspects ensure smooth thread thread actions


of different coordination. effectively.
domains.

Chapter 7: Collections
Topics: Collection Interfaces, Linked Lists, ArrayLists, Hash Sets, TreeSets, Object
Comparison, Queues and Dequeues, Priority Queues, Maps.
Course Outcome-CO 3 - Design and implement real-world applications using object-
oriented principles of java language.

Competency PI Breaking Down at Concept Course Specific


Level performance indicators
(CSPIs)
1.1Demonstr 1.1.1Apply  Define collection interfaces Apply the fundamental
ate the mathematic and explore the roles of principles of collections
competence al List, Set, and Queue. to implement interfaces
Explain ordered collections like List, Set, and Queue
in techniques
and index-based access. helps break down
mathematica to model  Compare the performance complex data-related
l modelling. and solve of hash-based and tree- problems efficiently.
computing based sets.
problems.
1.4Demonstr 1.4.1: Apply  Explore various data Understand the
ate collection structures, including Lists, importance of ArrayLists
competence types like Sets, and Queues, for dynamic data storage
highlighting the importance and manipulation. Use
in computing lists and
of selecting the right data appropriate data
knowledge sets to solve structure for optimal structures to solve
computation performance and efficiency. problems efficiently.
al problems. Understand ArrayLists and
their practical applications.
5.1Demonstr 5.1.1  Understand the collection Use HashSet and TreeSet
ate an ability Identify framework by exploring to manage unique
to identify/ modern ArrayList and LinkedList for elements, HashMap and
data storage, HashSet and TreeMap for key-value
create computing
TreeSet for managing pair storage, and Queues
modern tools, unique elements, and and PriorityQueues for
computing techniques HashMap and TreeMap for ordered data processing.
tools, and key-value pair operations.
techniques resources  Learn about Queues and
and for PriorityQueues for ordered
resources computing data processing and use
Iterators to navigate
activities
collections efficiently.
7.1Demonstr 7.1.2Identify  Define collection interfaces Understand collection
ate an ability deficiencies and iterators, compare interfaces like List, Set,
to identify or gaps in different collections such as Map, and Queue and
Lists, Sets, Maps, and their uses. Utilize
gaps in knowledge
Queues. Iterators to traverse and
knowledge and
and a demonstrate

10
DEPARTMENT OF COMPUTER APPLICATIONS

strategy to an ability to  Understand object modify collection


close these source comparison for effective elements efficiently.
gaps information data management.
to close this
gap.

11
DEPARTMENT OF COMPUTER APPLICATIONS

Course Content

Course Code: 24EBCC205 Course Title: Java Programming


L-T-P: 3-0-2 Credits: 5 Contact Hrs.: 7
ISA Marks: 50 ESA Marks: 50 Total Marks: 100
Teaching Hrs.: 40+48 Exam Duration: 3

Content Hrs.
Unit – 1
Chapter 1: Introduction 5
Java Fundamentals, The History, and Philosophy of Java, Java’s Magic: The Byte
code, The Java Buzzwords, The Java Development Kit, A First Simple Program,
Data Types, Variables, Constants, Operators, Control Statements
Chapter 2: Introducing Classes, Objects, and Methods 8
Class Fundamentals, Object Creation, Reference Variables and Assignment,
Methods, Constructors and its types, the new Operator Revisited, Garbage
Collection, This Keyword, Java’s Access Modifiers, Pass Objects to Methods,
Method Overloading, Constructors Overloading, static keyword, Static Blocks,
Introducing Nested and Inner Classes.
Unit - 2
Chapter 3: Inheritance 6
Inheritance basics, constructors and Inheritance, understanding super keyword
and super class, creating a Multilevel Hierarchy, Superclass References and
Subclass Objects, Method Overriding, Using Abstract Classes, using final: To
prevent overriding and inheritance, Using final with Data Members, the Object
Class.
Chapter 4: Packages and Interfaces 6
Working with Package, packages and member access, Understanding Protected
Members, Importing Packages, Implementing Interfaces, Using Interface
References, default method example, Multiple Inheritance Issues, Use static
Methods in an Interface, Private Interface Methods.
Chapter 5: Exception Handling 5
The Exception Hierarchy, Exception Handling Fundamentals, Using Try and catch
blocks, the consequences of an uncaught exception, using multiple catch
statements, catching subclass exceptions, Throwing an Exception, Rethrowing an
Exception, A Closer Look at Throwable, Java’s Built-in Exceptions, Creating
Exception Subclasses.
Unit – 3
Chapter 6: Multithread Programming 5
Multithreading Fundamentals, The Thread Class and Runnable Interface, creating
a Thread, Creating Multiple Threads, Determining When a Thread Ends, Thread
Priorities, Synchronization, Using Synchronized Methods.

12
DEPARTMENT OF COMPUTER APPLICATIONS

Chapter 7: Collections 5
Collection Interfaces, Collection and Iterator Interfaces in the Java Library, Linked
Lists, Array Lists, Hash Sets, Tree Sets, Object Comparison, Queues and Dequeues,
Priority Queues, Maps.

Text Books

1. Herbert Schildt, Java: A Beginner’s Guide Ninth Edition, 9th Edition, McGraw Hill;
Eighth edition(2022).
2. Herbert Schildt, JAVA The Complete Reference 11th edition, Tata McGraw Hill 2019.

References

1. Kathy Sierra: Head First Java: A Brain-Friendly Guide, Third Edition, Shroff/O'Reilly;
Third edition (1 June 2022).

Evaluation Scheme
1. In Semester Assessment (ISA)
Assessment Marks

ISA- 1 20

ISA- 2 20

Activities 10

ISA 50

ESA 50

Total 100

13
DEPARTMENT OF COMPUTER APPLICATIONS

Course Unitization for Minor Exams and End Semester Assessment

No. of No. of No. of No. of


Topics / Chapters Teaching Questions Questions Questions in Questions
Credits in ISA-1 in ISA-2 Quiz/Activity in ESA

Unit I

1. Introduction 5 1 - 1 1

2. Introducing
Classes, Objects, 8 1 - 1 1
and Methods

Unit II

3. Inheritance 6 - 1 1 1
4. Packages and 6 - 1 1 1
Interfaces
5. Exception
5 - 1 1 1
Handling
Unit III
6. Multithread 5 - - 1 1
Programming
7. Collections 5 - - 1 1

Note:
1. Each Question carries 20 marks and may consist of sub-questions.
2. Mixing of sub-questions from different chapters within a unit (only for Unit I and Unit II)
is allowed in Minor I, II and ESA
3. Answer 5 full questions of 20 marks each (two full questions from Unit I, II and one
full question from Unit III) out of 8 questions in ESA.

Date: Head of Department

14
DEPARTMENT OF COMPUTER APPLICATIONS

Course Assessment Plan

Course Title: Java Programming Code: 24EBCC205

Weightage Assessment Methods


Course outcomes (COs) in
assessment ISA-1 ISA-2 Assignments ESA
1. Explain the platform-
independent 
programming language 25  
and object-oriented
concepts.
2. Apply exception
handling, Interfaces
and Inheritance 25   
multithreaded concepts
to implement a given
scenario.
3. Design and implement
real-world applications
using object-oriented 25  
principles of java
language.

Weightage 20% 20% 10% 50%

15
DEPARTMENT OF COMPUTER APPLICATIONS

Chapter Wise Plan


Course Code and Title: 24EBCC205/ Java Programming
Chapter Number and Title: 1. Introduction Planned Hours: 5hrs.

Learning Outcomes: -
At the end of the topic, the student should be able to:

Topic Learning Outcomes COs BL CA Code


1. Recognize the History and Philosophy of Java and its Relation CO1 L2 1.3
with the Internet.
2. Compiling concepts and Articulate simple programs CO1 L3 1.4

Lesson Schedule
Class No. - Portion covered per hour
1. Java Fundamentals, The History and Philosophy of Java,
2. The Byte code, The Java Buzzwords,
3. The Java Development Kit, A First Simple Program,
4. Data Types, Variables, Constants,
5. Operators, Control Statements

Review Questions
[Link]. - Questions TLOs BL PI Code
1. Explain JDK. Which part of JVM will allocate memory
TLO1 L2 5.2.2
for Java program?
2. Write a Java Program to Read the Number from
TLO2 L3 1.3.1
Standard Input.

3. What are Data Types? Explain different types of Data TLO1 L2 1.3.1
Types with examples.

4. Write a Java Program to Swap Two values using third TLO2 L3 5.2.2
variable

16
DEPARTMENT OF COMPUTER APPLICATIONS

5. What is the output of the following Java program?


class Test
{
public static void main (String args[])
{ TLO2 L3 5.2.2
[Link](10 + 20 + "Javatpoint");
[Link]("Javatpoint" + 10 + 20);
}
}

Course Code and Title: 24EBCC205/ Java Programming


Chapter Number and Title: 2. Introducing Classes, Objects, Planned Hours:
and Methods 8hrs.

Learning Outcomes: -
At the end of the topic the student should be able to:

Topic Learning Outcomes COs BL CA Code

1. Design and instantiate classes by implementing the concepts of CO1 L2 1.3.1


Java.
2. Clone objects and use of Methods in designing applications. CO1 L2 1.3.1

3. Build Inner classes and Constructors of various types for


CO1 L2 2.2.1
designing cooperating class collections.

Lesson Schedule
Class No. - Portion covered per hour
1. Class Fundamentals, Object Creation,
2. Reference Variables and Assignment,
3. Methods, Constructors and its types,
4. the new Operator Revisited, Garbage Collection, This Keyword,
5. Java’s Access Modifiers, Pass Objects to Methods,
6. Method Overloading, Constructors Overloading,
7. static keyword, Static Blocks,
8. Introducing Nested and Inner Classes.

Review Questions
[Link]. - Questions TLOs BL PI Code
1. How do you design classes and instantiate them in Java?
TLO1 L2 1.3.1
Give code example.

17
DEPARTMENT OF COMPUTER APPLICATIONS

2. What is the output of the following Java program?


class Test
{
int i;
}
public class Main
{ TLO1 L3 2.2.1
public static void main (String args[])
{
Test test = new Test();
[Link](test.i);
}
}

3. What are Access specifiers? Can we declare a class as TLO1 L2 2.2.1


“private”?
4. Write a Java program to create a cass called "Rectangle"
with width and height attributes. Calculate the area and TLO2 L3 2.2.1
perimeter of the rectangle.
5. Write a Java program to create a class called "Bank" with
a collection of accounts and methods to add and remove
TLO3 L3 2.2.1
accounts, and to deposit and withdraw money. Also define
a class called "Account" to maintain account details of a
particular customer.

Course Code and Title: 24EBCC205/ Java Programming


Chapter Number and Title: 3. Inheritance Planned Hours: 6hrs.

Learning Outcomes: -
At the end of the topic, the student should be able to:
Topic Learning Outcomes COs BL CA Code
1. Design and build classes on the concept of Inheritance CO2 L3 3.2.1
2. Design and Implementing Method Overloading and Method
Overriding with the support of Polymorphism and using CO2 L2 3.3.1
Abstract classes
3. Write programs using the final keyword with Data members
CO2 L3 13.1.1
and Object class.

Lesson Schedule
Class No. - Portion covered per hour

1. Introduction to Inheritance, Constructors, and Inheritance


2. Understanding super keyword and super class,
3. Creating a Multilevel Hierarchy, Superclass References, and subclass objects
4. Method Overriding, Using Abstract classes.
5. Using final, final prevents overriding, final prevents Inheritance

18
DEPARTMENT OF COMPUTER APPLICATIONS

6. Using final with Data Members, The Object Class

Review Questions
[Link]. - Questions TLOs BL PI Code
1. What is Inheritance? Why is multiple inheritance not
TLO1 L2 3.2.1
supported in java?
2. What is the output of this following code snippet?
class A
{
int i = 10;
}

class B extends A
{
int i = 20;
}
TLO1 L3 3.2.1
public class MainClass
{
public static void main(String[] args)
{
A a = new B();

[Link](a.i);
}
}
3. Write a program to access the superclass instance variable
TLO1 L3 3.2.1
and superclass method directly in the subclass using the
super keyword.
4. Explain Method Overloading. Distinguish between Method TLO2 L2 3.3.1
Overloading and Method Overriding
5. Write a program where the superclass's calculate () method
3.3.1
is overridden by the calculate() method of the subclass. The TLO1 L3
behavior of the calculate() method is dynamically decided.

Course Code and Title: 24EBCC205/ Java Programming


Chapter Number and Title: 4. Packages and Interfaces Planned Hours: 6hrs.

Learning Outcomes:-
At the end of the topic, the student should be able to:
Topic Learning Outcomes COs BL CA Code
1. Building packages and Designing classes with Access Specifiers CO2 L3 3.1.1
2. Design interfaces for implementing the techniques of Multiple CO2 L3 13.1.1
Inheritance

19
DEPARTMENT OF COMPUTER APPLICATIONS

Lesson Schedule
Class No. - Portion covered per hour
1. Introduction to Package, Defining Package, Working with Package,
2. Packages and Member access,
3. Understanding Protected Members, Importing Packages,
4. Interfaces, Implementing Interfaces, Using Interface References,
5. Default method example, Multiple Inheritance Issues,
6. Use static Methods in an Interface, Private Interface Methods.

Review Questions
[Link]. - Questions TLOs BL PI Code
1. What are Interfaces? Why are the methods of Interface
TLO2 L2 3.1.1
public and abstract by default?
2. Write a Java program to create a Animal interface with a
method called bark() that takes no arguments and returns
TLO2 L3 13.1.1
void. Create a Dog class that implements Animal and
overrides speak() to print "Dog is barking".
3. What will be the output of the following code snippet?

interface A {
int x = 10;
}
interface B {
int x = 20;
}
interface C extends A, B{
TLO2 L3 13.1.1
int x = 30;
public static void main(String[] args){
int a = A.x; int b = B.x;
int c = C.x;
[Link](a);
[Link](b);
[Link](c);
}
}
4. Write a Java program to create an interface Shape with the
getArea() method. Create three classes Rectangle, Circle,
and Triangle that implement the Shape interface. TLO1 L3 13.1.1
Implement the getArea() method for each of the three
classes.
5. Can I import the same package/class twice? Will the JVM
TLO1 L2 13.1.1
load the package twice at runtime?

20
DEPARTMENT OF COMPUTER APPLICATIONS

Course Code and Title: 24EBCC205/ Java Programming


Chapter Number and Title: 5. Exception Handling Planned Hours:
5hrs.

Learning Outcomes: -
At the end of the topic, the student should be able to:
Topic Learning Outcomes COs BL CA Code
1. Build custom exception handlers using the Java Exception CO2 L3 3.1.1
class and its members.
2. Use Additional features in building Exception Handling CO2 L3 5.1.1
programs, including keywords, Built-in exceptions finally.
3. Creating Exception sub-class. CO2 L3 13.1.1

Lesson Schedule
Class No. - Portion covered per hour
1. The Exception Hierarchy, Exception Handling Fundamentals, Using Try and catch
2. Simple Exception Handling example, Consequences of Uncaught Exception, Exception
enables to handle the error.
3. Using Multiple catch statements, Catching Subclass Exceptions
4. Try Blocks can be Nested, Throwing an Exception, Rethrowing an Exception, Closer look
at Throwable.
5. Finally, Using Throws, Additional features, Java’s Built-in Exceptions, and Creating
Exception Subclasses.

Review Questions
[Link]. - Questions TLOs BL PI Code
1. How can you handle Exceptions in Java? Why do we need
TLO1 L2 3.1.1
Exception Handling in Java?
2. What will be the output of the following code snippet?

class Main {
public static void main(String args[]) {
try {
throw 10;
} TLO1 L3 5.1.1
catch(int e) {
[Link]("Got the Exception " + e);
}
}
}

3. What is the output of the following code snippet?


public class ExceptionHandlingExample {
TLO2 L3 13.1.1
public static void main(String args[])
{

21
DEPARTMENT OF COMPUTER APPLICATIONS

try
{
int a = 1/0;
[Link]("a = "+a);
}
catch(Exception e){[Link](e);}
catch(ArithmeticException
ex){[Link](ex);}
}
}
4. Write a Java program to create a method that takes an
integer as a parameter and throws an exception if the TLO2 L3 5.1.1
number is odd.
5. Write a program that shows how to handle the
ArithematicException and TLO2 L3 13.1.1
ArrayIndexOutOfBoundsException

Course Code and Title: 24EBCC205/ Java Programming


Chapter Number and Title: 6. Multithread Programming Planned Hours: 5hrs.

Learning Outcomes:-
At the end of the topic, the student should be able to:
Topic Learning Outcomes COs BL CA Code
1. Explain the advantages and potential problems of threading
CO2 L2 3.1.1
and identify the critical sections.
2. Write synchronized Thread code using Thread class and by CO2 L3 13.1.1
implementing the Runnable Interface

Lesson Schedule
Class No. - Portion covered per hour
1. Multithreading Fundamentals, The Thread class, and Runnable Interface
2. Creating Thread, One improvement, and two Simple Variations,
3. Creating multiple Threads, determining when a Thread ends
4. Thread priorities, Synchronization
5. Using Synchronized Methods, The Synchronized Statement.

Review Questions
[Link]. - Questions TLOs BL PI Code
1. What are the uses of threads? Explain the creation of Threads TLO1 L2 3.1.1
and how you run it.

22
DEPARTMENT OF COMPUTER APPLICATIONS

2. Write a program to create MyThread class with the run()


method and then attach a thread to this MyThread class TLO2 L3 5.1.1
project.
3. What is the difference between ‘extends Thread’ and TLO1 L2 5.1.1
‘implements Runnable’? Which one is advantageous?
4. Write a Java program that sorts an array of integers using TLO2 L3 13.1.1
multiple threads.
5. What is Thread synchronization? What is the difference
TLO2 L3 13.1.1
between a synchronized block and a synchronized keyword?

Course Code and Title: 24EBCC205/ Java Programming


Planned Hours:
Chapter Number and Title: 7. Collections
5hrs.

Learning Outcomes: -
At the end of the topic, the student should be able to:
Topic Learning Outcomes COs BL CA Code
1. To store, retrieve, manipulate, and communicate aggregate
CO3 L2 1.1.1
data.
2. What is an ArrayList in Java? How does it differ from an Array CO3 L3 1.4.1
and a Collection in Java?

Lesson Schedule
Class No. - Portion covered per hour
1. Collection Interfaces, Collection and Iterator Interfaces in the Java Library,
2. Linked Lists, Array Lists,
3. Hash Sets, Tree Sets,
4. Object Comparison, Queues and Dequeues,
5. Priority Queues, Maps.

Review Questions
[Link]. - Questions TLOs BL PI Code
1. What is Collection in Java? What are the various interfaces TLO1 L2 1.1.1
used in Java Collections Framework?
2. What is ArrayList in Java? What is the difference between
TLO1 L3 1.4.1
Array and Collection in Java?
3. Write a Java program to search for an element in an array
TLO2 L3 5.1.1
list.

23
DEPARTMENT OF COMPUTER APPLICATIONS

4. Write a program to convert a given array into a collection TLO2 L3 5.1.1


with the asList() method.
5. Write a program in java to get the collection view of the
TLO2 L3 7.1.2
values present in a HashMap.

Question Paper Title: Model Question Paper for ISA I


Total Duration (H: M):75 Course: Java Programming Maximum
mins (24EBCC205) Marks:40
Note: Answer any TWO full questions
[Link]. Questions Marks CO BL PO PI
Code

1a What is the difference between JDK, JRE, and 5 CO1 L2 1 5.2.2


JVM? How many types of memory areas are
allocated by JVM?

1b Write a Java program to declare a Boolean 5 CO1 L2 1 1.3.1


variable with the initial " true " value and change
it to "false" before printing it.

1c What are different types of Data Types? What is 10 CO1 L3 3 1.3.1


the difference between Float and Double?
Explain with an example.
2a Consider the following class: 5 CO1 L3 3 5.2.2
public class IdentifyMyParts {
public static int x = 7;
public int y = 3;
}
a. What are the class variables?
b. What are the instance variables?
c. What is the output from the following
code:
IdentifyMyParts a = new IdentifyMyParts();
IdentifyMyParts b = new IdentifyMyParts();
a.y = 5;
b.y = 6;
a.x = 1;
b.x = 2;
[Link]("a.y = " + a.y);
[Link]("b.y = " + b.y);
[Link]("a.x = " + a.x);
[Link]("b.x = " + b.x);
[Link]("IdentifyMyParts.x = " +
IdentifyMyParts.x);

24
DEPARTMENT OF COMPUTER APPLICATIONS

2b Explain the initialization of Variables. 5 CO1 L2 3 1.3.1


Distinguish between initializing a variable and
dynamic initialization of a variable.
2c Explain method overloading?What are rules of 10 CO1 L3 3 2.2.1
method overloading?
Predict output of the following code snippet.

public class MethodOverloadingExample {

public void methodTest(Object object)


{
[Link]("Calling object method");
}

public void methodTest(String object)


{
[Link]("Calling String method");
}

public static void main (String args[])


{
MethodOverloadingExamplemoe=new
MethodOverloadingExample();
[Link](null);
}
}
3a How do you create an inner class instance from 5 CO1 L3 2 1.3.1
a class other than the enclosing class? Write a
code to illustrate this.
3b When is a Constructor called, before or after 5 CO1 L2 2 2.2.1
creating the object? What is the difference
between a Default constructor and
parameterized constructor?
3c What is constructor overloading? What is the 10 CO1 L2 2 2.2.1
difference between a constructor and a
method?Write a program to understand the use
of methods in a class.

25
DEPARTMENT OF COMPUTER APPLICATIONS

Question Paper Title: Model Question Paper for ISA II


Total Duration (H: M):75 Course: Java Programming Maximum
mins (24EBCC205) Marks:40
Note: Answer any TWO complete questions
[Link]. Questions Marks CO BL PO PI
Code

1a What is Inheritance? What are the different 10 CO2 L2 3 3.2.1


types of Inheritance? Explain with examples.
1b Write a program to access the superclass 5 CO2 L3 3 3.2.1
instance variable and superclass method
directly in the subclass using the super
keyword.
1c What is the output of this following code 5 CO2 L3 3 3.2.1
snippet?
class A
{
int i = 10;
}

class B extends A
{
int i = 20;
}

public class MainClass


{
public static void main(String[] args)
{
A a = new B();

[Link](a.i);
}
}
2a Write a Java program to create a class called 10 CO2 L3 3 3.3.1
Shape with a method called getArea(). Create a
subclass called Rectangle that overrides the
getArea() method to calculate the area of a
rectangle.

26
DEPARTMENT OF COMPUTER APPLICATIONS

2b 10 CO2 L3 3 3.1.1
Assume you have written some classes.
Belatedly, you decide they should be split
into three packages, as listed in the following
table. Furthermore, assume the classes are
currently in the default package (they have
no package statements).
Package Name Class Name

[Link] Server

[Link] Utilities

[Link] Client

1. Which line of code will you need to


add to each source file to put each
class in the right package?
2. To adhere to the directory structure,
you will need to create some
subdirectories in the development
directory and put source files in the
correct subdirectories. What
subdirectories must you create?
Which subdirectory does each source
file go in?
3. Do you think you'll need to make
any other changes to the source files
to make them compile correctly? If
so, what?

3a How can you handle Exceptions in Java? Why 10 CO1 L3 3 3.1.1


do we need Exception Handling in Java? What
is the difference between Exception and Error
in Java?
3b Write a program that shows how to handle the 10 CO1 L3 3 13.1.1
ArithematicException and
ArrayIndexOutOfBoundsException

27
DEPARTMENT OF COMPUTER APPLICATIONS

Question Paper Title: Model Question Paper for Semester-End Examination


Total Duration (H: Course:Java Programming Maximum Marks:100
M):3 Hrs (24EBCC205)
Note:i) Answer any TWO full questions from UNIT I, any TWO full questions
from UNIT II, and any ONE full question from UNIT III. ii) Missing data may
be suitably assumed with justification.
Q. Questions Marks CO BL PO PI
No. Code
Unit 1
1a What is the difference between JDK, JRE, and 5 CO1 L2 1 5.2.2
JVM? How many types of memory areas are
allocated by JVM?
1b Write a Java program to declare a Boolean 5 CO1 L2 1 1.3.1
variable with the initial value of "true" and
change it to "false" before printing it.
1c Design a class Bicycle with integer data 10 CO1 L3 2 2.2.1
members' speed and gear. Include methods
that will manipulate the values of speed and
gear. Provide overloaded constructors. Finally,
write a driver program this.
2a Consider the following class: 5 CO1 L3 3 1.3.1
public class IdentifyMyParts {
public static int x = 7;
public int y = 3;
}
a. What are the class variables?
b. What are the instance variables?
c. What is the output from the following
code:
IdentifyMyParts a = new IdentifyMyParts();
IdentifyMyParts b = new IdentifyMyParts();
a.y = 5;
b.y = 6;
a.x = 1;
b.x = 2;
[Link]("a.y = " + a.y);
[Link]("b.y = " + b.y);
[Link]("a.x = " + a.x);
[Link]("b.x = " + b.x);
[Link]("IdentifyMyParts.x = " +
IdentifyMyParts.x);
2b Find the output of below Java program: 5 CO1 L3 3 5.2.2

public class Main


{
public static int a;

public Main(){

28
DEPARTMENT OF COMPUTER APPLICATIONS

a=10;
}

public static void printMe(){


[Link](a);
}

public static void main (String [] args) {


printMe();
}

}
2c Explain method overloading?What are rules of 10 CO1 L3 3 3.3.1
method overloading?
Predict output of below program:
public class MethodOverloadingExample {

public void methodTest(Object object)


{
[Link]("Calling object method");
}

public void methodTest(String object)


{
[Link]("Calling String method");
}

public static void main (String args [])


{
MethodOverloadingExamplemoe=new
MethodOverloadingExample();
[Link](null);
}
}
3a What is constructor overloading? What is the 5 CO1 L3 2 2.2.1
difference between a constructor and a
method?Write a program to understand the
use of methods in a class.
3b How do you create an inner class instance 5 CO1 L2 2 1.3.1
from a class other than the enclosing class?
Write a code to illustrate this.
3c Write a Java program to compute the student's 10 CO1 L3 2 5.2.2
results by considering marks obtained in 4
courses. (Assume standard Grading criteria as
per KLETECH university norms)

Unit 2

29
DEPARTMENT OF COMPUTER APPLICATIONS

4a What is Inheritance? What are the different 10 CO2 L2 3 3.2.1


types of Inheritance? Explain with examples.
4b Write a program to access the superclass 10 CO2 L3 3 3.2.1
instance variable and superclass method
directly in the subclass using the super
keyword.
5a Write a Java program to create a class called 10 CO2 L3 3 3.3.1
Shape with a method called getArea(). Create a
subclass called Rectangle that overrides the
getArea() method to calculate the area of a
rectangle.
5b 10 CO2 L3 3 3.1.1
Assume you have written some classes.
Belatedly, you decide they should be split
into three packages, as listed in the
following table. Furthermore, assume the
classes are currently in the default package
(they have no package statements).
Package Name Class Name

[Link] Server

[Link] Utilities

[Link] Client

1. Which line of code will you need to


add to each source file to put each
class in the right package?
2. To adhere to the directory
structure, you will need to create
some subdirectories in the
development directory and put
source files in the correct
subdirectories. What subdirectories
must you create? Which
subdirectory does each source file
go in?
3. Do you think you'll need to make
any other changes to the source
files to make them compile
correctly? If so, what?

6a How can you handle Exceptions in Java? Why 10 CO2 L3 3 3.1.1


do we need Exception Handling in Java? What
is the difference between Exception and Error
in Java?
6b Write a program that shows how to handle the 10 CO2 L3 3 13.1.1
ArithematicException and
ArrayIndexOutOfBoundsException
30
DEPARTMENT OF COMPUTER APPLICATIONS

Unit 3
7a Write a program to create two threads so one 10 CO2 L3 3 3.1.1
thread will print ascending numbers whereas
second thread will print descending numbers
between sequence 1 to 15 numbers.
7b How to implement thread using runnable 10 CO2 L3 3 5.1.1
Interface in Java, With example.
8a What are the main differences between array 10 CO3 L3 3 1.4.1
and collection?Explain various interfaces used
in Collection framework?

8b What is the difference between HashSet and 10 CO3 L3 3 5.1.10


TreeSet?Write a program to convert a given
array into a collection with the asList() method.

Lab Activities

Demonstration
Q1 Java fundamentals
Q2 Inheritance
Q3 Interfaces and packages
Q4 Exception handling and collections
Exercises
A bank maintains two kinds of accounts – Savings account and Current account.
The savings account provides simple interest, deposit and withdrawal facilities. The
current account only provides deposit and withdrawal facilities. Current account
holders should also maintain minimum balance. If balance falls below minimum level
a service charge is imposed. Create an abstract class Account that stores customer
name, account number type of account and abstract methods. From this derive the
classes CurrAccount(double balance,doublemin_bal,doubleserviceCharge/penalty)
and SavAccount (double balance). Include the necessary methods in order to achieve
the following:
Q5 a. Define parameterized constructor in a class hierarchy.
b. Allow deposit and update the balance (cerditAmount(amt), debitAmt(amt)).
c. Display the balance (printBAlance()).
d. Compute interest and add to balance (computeInterest()).
e. Apply polymorphism if required for methods in class hierarchy.
f. Create an array of super class / object and populate with subclass objects
and call the overridden / object methods.
g. Write a test program to demonstrate the above said implementations.

The cricket player is described by CricketPlayer(name,


specialist(batsMan/bowler/wicketKeeper), numberOfWickets,
Q6 numberOfRuns, numberOfStumps , nomberOfMatchesPlayed).

Perform the following

31
DEPARTMENT OF COMPUTER APPLICATIONS

a. Create a class CricketPlayer to model the cricket player with


b. appropriate constructor and one among shall be copy constructor.
c. Create objects using all the constructors.
d. Write a function to update: numberOfWickets/numberOfRuns/
numberOfStumps based on the type of specialist.
e. Write a overloaded function to print player details.
f. Create more than one player and update data using array of objects.
The application shall print the number of objects created.
The University_Employee object is defined by University_Employee{empId,
empName, empSal, empType,empBonus}.

empType=Dean/Professor/Instructor

Perform the following

a. Define appropriate constructors to create employee objects.


Q7 b. Write an overloaded function to print employee details.
c. Write a function to pay bonus to employees based on employee type as % of
salary and print employee details before and after paying bonus.
d. The employer is planning to compute expenditure to pay bonus for 4 years
for all his employees (Assume number of employees: example 3 to 5), write a
function to know the total expenditure to pay the bonus.

Write a java program to model a point object on a 2D plane. The point is described
by x and y coordinates. The point object can be moved to any location in a 2D plane
and the coordinates can be reset (0,0). The java program shall also print the
coordinates of a point object.

Q8 Apply default and parameterized constructor.


Problem solving frame work:
a. Identify object/class: Point
b. Identify the properties: xCoordinate, yCoordinate
c. Identify functions: void printPoint(), void resetPoint(), void movePoint(int a, int
b)
Write a program by creating a class named 'Student' having two methods.

Perform the following:

a. First method named as 'readDetails() This method should accept the


following details from the user:

Q9  Student's name (string)


 Year of admission (string)
 Student's marks (float)
 Address (string)
b. second method displayDetails()’ that would print the information (name,
year of admission, marks, address) of the students as follows:
Student Information:

32
DEPARTMENT OF COMPUTER APPLICATIONS

Name: [Student's Name]

Year of Admission: [Year of Admission]

Marks: [Student's Marks]

Address: [Student's Address]

Develop a banking system that allows users to perform transactions like deposit and
withdrawal. Implement an "Account" class with appropriate exception handling for
invalid transactions.
Problem solving frame work:
a. Identify object/class: Account
b. Identify the properties: accountNumber, accountHolderName, balance
c. Identify functions: Account (), deposit (), withdraw () and getbalance()
d. Implement the “InvalidAmountException” custom exceptions as follows:
Q10
class Name: InvalidAmountException
Data Members: message
Methods: InvalidAmountException(String message), getMessage()
e. Implement the “InsufficientFundsException” custom exceptions as follows:
Class Name:
Data Members: message
Methods: InsufficientFundsException(String message), getMessage()

Structured Enquiry
Scenario
Consider the Bank Account of type Savings account, current account and money can
be debited or credited to bank accounts. The number of transactions is limited to 5
Q11 on both the accounts, if it exceeds a penalty has to be imposed and the penalty
amount has to be automatically debited from account. The details of the bank
accounts shall be printed. Identify base class and derived classes, attributes and
functions in a class hierarchy. Write a java program to simulate the.

33

You might also like