Location via proxy:   [ UP ]  
[Report a bug]   [Manage cookies]                
0% found this document useful (0 votes)
2 views

java_sem4_parth(10)

The document outlines the vision and mission of the DTE and the institute, emphasizing the importance of providing competitive technical education and resources for students. It includes a lab manual for the Object Oriented Programming with JAVA course, detailing practical outcomes, industry-relevant skills, and guidelines for both teachers and students. The curriculum is designed to enhance practical skills and competencies in programming, focusing on real-world applications and effective learning strategies.

Uploaded by

sohanmomin000
Copyright
© © All Rights Reserved
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
2 views

java_sem4_parth(10)

The document outlines the vision and mission of the DTE and the institute, emphasizing the importance of providing competitive technical education and resources for students. It includes a lab manual for the Object Oriented Programming with JAVA course, detailing practical outcomes, industry-relevant skills, and guidelines for both teachers and students. The curriculum is designed to enhance practical skills and competencies in programming, focusing on real-world applications and effective learning strategies.

Uploaded by

sohanmomin000
Copyright
© © All Rights Reserved
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 106

1|Page

236170316008 Object Oriented Programming with JAVA (4341602)

DTE’s Vision:

• To provide globally competitive technical education; Remove geographical imbalances and


inconsistencies;
• Develop student friendly resources with a special focus on girls’ education and support to
weaker sections;
• Develop programs relevant to industry and create a vibrant pool of technical professionals.

Institute’s Vision:

Institute’s Mission:

Department’s Vision:

Department’s Mission:

IT-SEM 4-A 2|Page


236170316008 Object Oriented Programming with JAVA (4341602)

Certificate
This is to certify that Mr./Ms.…………………………………………………….…………………..….

Enrollment No. ……………………………………………....of…….…………. Semester of Diploma

in.....…….………………..………..…………………………………………………….…………………………………

of

Institute,...…………………………………………………………..........................................................

... (GTU Code: ………...…...) has satisfactorily completed the term work satisfactorily in

course Object Oriented Programming with JAVA –4341602 for the academic

year:…..…….……… Term: ………….…… as prescribed in the GTU curriculum.

Place: ……………………….……

Date: …………………………..…

Signature of Course Faculty Head of the Department

IT-SEM 4-A 3|Page


236170316008 Object Oriented Programming with JAVA (4341602)

Preface

The primary aim of any laboratory/Practical/field work is for enhancing required skills as well as
creating ability amongst students to solve real time problem by developing relevant competencies
in psychomotor domain. By keeping in view, GTU has designed competency focused outcomebased
curriculum-2021 (COGC-2021) for engineering diploma programmers. In this more time allotted to
practical work than theory. It shows importance of enhancement of skills amongst students and it
pays attention to utilize every seconds of time allotted for practical amongst students, instructors
and Lecturers to achieve relevant outcomes by performing rather than writing practice in study type.
It is essential for effective implementation of competency focused outcome-based green
curriculum-2021, every practical has been keenly designed to serve as a tool to develop & enhance
relevant industry needed competency in each and every student. These psychomotor skills are very
difficult to develop through traditional chalk and board content delivery method in the classroom.
Accordingly, this lab manual designed to focus on the industry defined relevant outcomes, rather
than old practice of conducting practical to prove concept and theory.

By using this lab manual, students can read procedure one day in advance to actual performance
day of practical experiment which generates interest and also, they have idea of judgement of
magnitude prior to performance. This in turn enhances predetermined outcomes amongst students.
Each and every experiment /Practical in this manual begins by competency, industry relevant skills,
course outcomes as well as practical outcomes which serve as a key role for doing the practical. The
students will also have a clear idea of safety and necessary precautions to be taken while performing
practical.

This manual also provides guidelines to lecturers to facilitate student-centered lab activities through
each practical / experiment by arranging and managing necessary resources in order that the
students follow the procedures with required safety and necessary precautions to achieve
outcomes. It also gives an idea that how students will be assessed by providing Rubrics.

Object oriented programming with JAVA course develop a depth understating about programming
paradigm, object orients programming concept like Inheritance, Encapsulation, Abstraction,
polymorphism etc. In the current industrial scenario JAVA has broad industry support and
prerequisite to many technologies. After learning this course student can write/develop platform
independent, object-oriented application using JAVA.

Although we try our level best to design this lab manual, but always there are chances of
improvement. We welcome any suggestions for improvement.

IT-SEM 4-A 4|Page


236170316008 Object Oriented Programming with JAVA (4341602)

Program Outcomes (Pos):

1. Basic and Discipline specific knowledge: Apply knowledge of basic mathematics, science and
engineering fundamentals and engineering specialization to solve the engineering problems.

2. Problem analysis: Identify and analyze well-defined engineering problems using codified
standard methods.

3. Design/ development of solutions: Design solutions for engineering well-defined technical


problems and assist with the design of systems components or processes to meet specified
needs.

4. Engineering Tools, Experimentation and Testing: Apply modern engineering tools and
appropriate technique to conduct standard tests and measurements.

5. Engineering practices for society, sustainability and environment: Apply appropriate


technology in context of society, sustainability, environment and ethical practices.

6. Project Management: Use engineering management principles individually, as a team member


or a leader to manage projects and effectively communicate about well-defined engineering
activities.

7. Life-long learning: Ability to analyze individual needs and engage in updating in the context of
Technological changes in field of engineering.

IT-SEM 4-A 5|Page


236170316008 Object Oriented Programming with JAVA (4341602)

Practical Outcome - Course Outcome matrix

NO PRACTICAL OUTCOME CO1 CO2 CO3 CO4

Install JDK and Setup a Java Programming development


environment by using:
1 Command Prompt (SET PATH command and using √ - - -
Environment Variable).
Any open source IDE
Test the java development environment setup by
2 implementing a simple java program (print: “OOP with JAVA”). √ - - -

Develop a basic java program that demonstrates data types of


3 √ - - -
JAVA.
Develop a Java program to swap two numbers without using a
temporary variable and with using a temporary variable (use
4 √ - - -
command line argument to accept value from user).

Develop programs to demonstrate use of -


5 if statement and its different form switch √ - - -
case statement
Develop program to demonstrate use of- for
6 loop √ - - -
‘while’ and ‘do while’ loop
Develop a Java program to find maximum and minimum
7 √ - - -
numbers from array elements.
Develop a basic java program that demonstrates the use of
8 - √ - -
Class & Object.
Develop a java program to find the factorial of a given number
9 - √ - -
using a recursive function.
Develop a java program that demonstrates method
10 - √ - -
overloading.
Develop a program for implementation of different functions
11 - √ - -
of String class.
Develop a program for implementation of Wrapper Class to
12 convert primitive value into object (Boxing) and object into - √ - -
primitive value (Un-boxing).
Develop a program with a static block and show that it will be
13 - √ - -
executed before the main() method in a class.
14 Develop a program to demonstrate use of static functions. - √ - -
Develop a program to demonstrate use of ‘this’ keyword.
15 Check whether ‘this’ can access the private members of the - √ - -
class or not.

IT-SEM 4-A 6|Page


236170316008 Object Oriented Programming with JAVA (4341602)
Develop a program with an overloaded constructor. Also
16 develop the copy constructor to create a new object with the - √ - -
state of the existing object.
Develop a program to demonstrate the use of private
constructor and also write a method which will count the
17 number of instances created using default constructor only. - √ - -

Develop a program to demonstrate single inheritance,


18 - √ - -
multilevel inheritance, and hierarchical inheritance.
Develop a program with one class named shape which has
two member functions named erase () and draw(). In the
19 - √ - -
program we have three other subclasses: circle, triangle and
square. Override methods of the super class into sub classes.
Develop a program for implementation of Dynamic method
20 - √ - -
dispatch.
Develop a java program that demonstrates the use of Abstract
21 - √ - -
class.
Develop a java program that illustrates interface inheritance.
Interface ‘A1’ and ‘A2’ are extended from interface ‘A’.
Interface ‘A12’ inherited from both ‘A1’ and ‘A2’. Each
22 interface declares one method and one constant. Class - √ - -
‘Interface_Imple’ implements ‘A12’. Instantiate
‘Interface_Imple’ and invoke each of its methods. Each
method displays one of the constants.
Develop a program to create a Package and demonstrate how
23 packages are used in java. and use java access modifier to - √ - -
demonstrate the access rules in a package.
Develop a program to demonstrate the use of ‘super’ and
24 - √ - -
‘final’ keywords.
Develop programs to demonstrate the use of Exception
25 - - √ -
Handling using predefined Exception Classes.
Develop a program to handle multiple exceptions using
26 - - √ -
multiple try blocks and multiple catch blocks.
27 Develop a program to implement user defined exceptions. - - √ -
Develop a program to demonstrate use of throw, throws, and
28 - - √ -
finally keyword.
Develop a program that executes two threads. One thread
displays “Java Programming” every 2 seconds, and the other
29 - - √ -
displays “Semester - 4th” every 5 seconds. (Create the threads
by extending the Thread class)
Develop a program that executes two threads. One thread will
print the even numbers and another thread will print odd
30 - - √ -
numbers between 1 to 10. (Create the thread by
implementing runnable interface)

IT-SEM 4-A 7|Page


236170316008 Object Oriented Programming with JAVA (4341602)
Develop a program to demonstrate use of synchronization of
31 threads when multiple threads are trying to update a - - √ -
common variable.
Develop programs to create, write, modify, read operations on
32 - - - √
Text files.

Industry Relevant Skills

The following industry relevant skills of the competency “Develop a program using object-oriented
programming concepts with java to solve the given problems.” are expected to be developed in the
student by undertaking the practical of this laboratory manual.

1. Select the appropriate programming paradigm to solve real world problems.


2. Develop object-oriented programs to support ideas of reusability, abstraction, encapsulation,
and polymorphism.
3. Develop a package with library classes.
4. Perform file operation on text file.

Guidelines to Teachers

1. Course faculty should demonstrate experiment with all necessary implementation strategies
described in curriculum.
2. Course faculty should explain industrial relevance before starting of each experiment.
3. Course faculty should involve& give opportunity to all students for hands on experience.
4. Course faculty should ensure mentioned skills are developed in the students’ byasking.
5. Utilize 2 hrs. of lab hours effectively and ensure completion of write up with quiz also.
6. Encourage peer to peer learning by doing same experiment through fast learners.

Instructions for Students

1. Organize the work in the group and make record of all observations.
2. Students shall develop maintenance skill as expected by industries.
3. Student shall attempt to develop related hand-on skills and build confidence.
4. Student shall develop the habits of evolving more ideas, innovations, skills etc.
5. Student shall refer technical magazines and data books.
6. Student should develop habit to submit the practical on date and time.
7. Student should well prepare while submitting write-up of exercise.

IT-SEM 4-A 8|Page


236170316008 Object Oriented Programming with JAVA (4341602)

Index
(Continuous Assessment Sheet)

Enrollment No: Term:


Name:

NO EXPERIMENT / PRACTICAL OUTCOME

Install JDK and Setup a Java Programming development environment by


using:
1 1. Command Prompt (SET PATH command and using Environment
Variable).
2. Any open source IDE

Test the java development environment setup by implementing a simple


2
java program (print: “OOP with JAVA”).

3 Develop a basic java program that demonstrates data types of JAVA.

Develop a Java program to swap two numbers without


using a temporary variable and with using a temporary
4
variable (use command line argument to accept value
from user).

Develop programs to demonstrate use of if statement and its different


5
formswitch case statement

Develop program to demonstrate use of- for loop


6.
‘while’ and ‘do while’ loop

IT-SEM 4-A 9|Page


236170316008 Object Oriented Programming with JAVA (4341602)

Develop a Java program to find maximum and minimum numbers from


7
array elements.

Develop a basic java program that demonstrates the use of Class &
8
Object.

Develop a java program to find the factorial of a given number using a


9
recursive function.

10 Develop a java program that demonstrates method overloading.

Develop a program for implementation of different functions of String


11
class.

Develop a program for implementation of Wrapper Class to convert


12 primitive value into object (Boxing) and object into primitive value
(Unboxing).

Develop a program with a static block and show that it will be executed
13
before the main() method in a class.

14 Develop a program to demonstrate use of static functions.

IT-SEM 4-A 10 | P a g e
236170316008 Object Oriented Programming with JAVA (4341602)

Develop a program to demonstrate use of ‘this’ keyword. Check whether


15
‘this’ can access the private members of the class or not.

Develop a program with an overloaded constructor. Also develop the


16 copy constructor to create a new object with the state of the existing
object.

Develop a program to demonstrate the use of private constructor and


17 also write a method which will count the number of instances created
using default constructor only.

Develop a program to demonstrate single inheritance, multilevel


18
inheritance, and hierarchical inheritance.

Develop a program with one class named shape which has two member
functions named erase () and draw(). In the program we have three other
19
subclasses: circle, triangle and square. Override methods of the super
class into sub classes.

20 Develop a program for implementation of Dynamic method dispatch.

21 Develop a java program that demonstrates the use of Abstract class.

Develop a java program that illustrates interface inheritance. Interface


‘A1’ and ‘A2’ are extended from interface ‘A’. Interface ‘A12’ inherited
from both ‘A1’ and ‘A2’. Each interface declares one method and one
22
constant. Class ‘Interface_Imple’ implements ‘A12’. Instantiate
‘Interface_Imple’ and invoke each of its methods. Each method displays
one of the constants.

Develop a program to create a Package and demonstrate how packages


23 are used in java. and use java access modifier to demonstrate the access
rules in a package.

IT-SEM 4-A 11 | P a g e
236170316008 Object Oriented Programming with JAVA (4341602)

Develop a program to demonstrate the use of ‘super’ and ‘final’


24
keywords.

Develop programs to demonstrate the use of Exception Handling using


25
predefined Exception Classes.

Develop a program to handle multiple exceptions using multiple try blocks


26
and multiple catch blocks.

27 Develop a program to implement user defined exceptions.

Develop a program to demonstrate use of throw, throws, and finally


28
keyword.

Develop a program that executes two threads. One thread displays “Java
29 Programming” every 2 seconds, and the other displays “Semester - 4th”
every 5 seconds. (Create the threads by extending the Thread class)

Develop a program that executes two threads. One thread will print the
30 even numbers and another thread will print odd numbers between 1 to
10. (Create the thread by implementing runnable interface)

Develop a program to demonstrate use of synchronization of threads


31
when multiple threads are trying to update a common variable.

32 Develop programs to create, write, modify, read operations on Text files.

IT-SEM 4-A 12 | P a g e
236170316008 Object Oriented Programming with JAVA (4341602)

PRACTICAL-1

• Install JDK and Setup a Java Programming development environment by


using:
1. Command Prompt (SET PATH command and using Environment Variable).
2. Any open source IDE

1. Command Prompt (SET PATH command and using Environment Variable).

• Go to the https://www.oracle.com/java/technologies/javase-jdk11-downloads.html this


website to download the JDK.

• Now click on the x64 installer and download and install this in your PC or laptop.

IT-SEM 4-A 13 | P a g e
236170316008 Object Oriented Programming with JAVA (4341602)

• Now click on next.

• now click on close.

IT-SEM 4-A 14 | P a g e
236170316008 Object Oriented Programming with JAVA (4341602)

Set up the PATH and JAVA_HOME using Command Prompt

• now go to the command prompt and write this command :-


➢ setx JAVA_HOME “C:\Program Files\Java\jdk-23”

• To Update The PATH Variable write this command :-


➢ setx PATH “C:\Program Files\Java\jdk-23\bin "

➢ To Verify the Setup write this command :-


➢ Java version

IT-SEM 4-A 15 | P a g e
236170316008 Object Oriented Programming with JAVA (4341602)

2. Any open source IDE

➢ For The Open Source IDE , I Used Visual Studio Code

IT-SEM 4-A 16 | P a g e
236170316008 Object Oriented Programming with JAVA (4341602)

IT-SEM 4-A 17 | P a g e
236170316008 Object Oriented Programming with JAVA (4341602)

Practical – 2

➢ Test the java development environment setup by implementing a simple java


program (print: “OOP with JAVA”).

IT-SEM 4-A 18 | P a g e
236170316008 Object Oriented Programming with JAVA (4341602)

IT-SEM 4-A 19 | P a g e
236170316008 Object Oriented Programming with JAVA (4341602)

Practical-3
➢ Develop a basic java program that demonstrates data types of JAVA.

IT-SEM 4-A 20 | P a g e
236170316008 Object Oriented Programming with JAVA (4341602)

Output:

IT-SEM 4-A 21 | P a g e
236170316008 Object Oriented Programming with JAVA (4341602)

IT-SEM 4-A 22 | P a g e
236170316008 Object Oriented Programming with JAVA (4341602)

PRACTICAL-4

➢ Develop a Java program to swap two numbers without using a temporary


variable and with using a temporary variable (use command line argument to
accept value from user).

IT-SEM 4-A 23 | P a g e
236170316008 Object Oriented Programming with JAVA (4341602)
OUTPUT:-

IT-SEM 4-A 24 | P a g e
236170316008 Object Oriented Programming with JAVA (4341602)

IT-SEM 4-A 25 | P a g e
236170316008 Object Oriented Programming with JAVA (4341602)

PRACTICAL :- 5
➢ Develop programs to demonstrate use of - if statement and its different form
switch case statement .

1.

IT-SEM 4-A 26 | P a g e
236170316008 Object Oriented Programming with JAVA (4341602)
2.

OUTPUT :-

1.

IT-SEM 4-A 27 | P a g e
236170316008 Object Oriented Programming with JAVA (4341602)
2.

IT-SEM 4-A 28 | P a g e
236170316008 Object Oriented Programming with JAVA (4341602)

IT-SEM 4-A 29 | P a g e
236170316008 Object Oriented Programming with JAVA (4341602)

PRACTICAL:- 6

➢ Develop program to demonstrate use of- for loop ‘while’ and


‘do while’ loop

IT-SEM 4-A 30 | P a g e
236170316008 Object Oriented Programming with JAVA (4341602)

OUTPUT :-

IT-SEM 4-A 31 | P a g e
236170316008 Object Oriented Programming with JAVA (4341602)

IT-SEM 4-A 32 | P a g e
236170316008 Object Oriented Programming with JAVA (4341602)

PRACTICAL :-7
➢ Develop a Java program to find maximum and minimum numbers from array
elements.

IT-SEM 4-A 33 | P a g e
236170316008 Object Oriented Programming with JAVA (4341602)

OUTPUT :-

IT-SEM 4-A 34 | P a g e
236170316008 Object Oriented Programming with JAVA (4341602)

IT-SEM 4-A 35 | P a g e
236170316008 Object Oriented Programming with JAVA (4341602)

Practical:-8

➢ Develop a basic java program that demonstrates the use of Class &
Object.

IT-SEM 4-A 36 | P a g e
236170316008 Object Oriented Programming with JAVA (4341602)

Output:-

IT-SEM 4-A 37 | P a g e
236170316008 Object Oriented Programming with JAVA (4341602)

IT-SEM 4-A 38 | P a g e
236170316008 Object Oriented Programming with JAVA (4341602)

Practical :-9
➢ Develop a java program to find the factorial of a given number using
a recursive function.

IT-SEM 4-A 39 | P a g e
236170316008 Object Oriented Programming with JAVA (4341602)

OUTPUT:-

IT-SEM 4-A 40 | P a g e
236170316008 Object Oriented Programming with JAVA (4341602)

IT-SEM 4-A 41 | P a g e
236170316008 Object Oriented Programming with JAVA (4341602)

Practical :-10
➢ Develop a java program that demonstrates method overloading.
Ou

output :-

IT-SEM 4-A 42 | P a g e
236170316008 Object Oriented Programming with JAVA (4341602)

IT-SEM 4-A 43 | P a g e
236170316008 Object Oriented Programming with JAVA (4341602)

Practical:-11
➢ Develop a program for implementation of different functions of
String class.

IT-SEM 4-A 44 | P a g e
236170316008 Object Oriented Programming with JAVA (4341602)

Output :-

IT-SEM 4-A 45 | P a g e
236170316008 Object Oriented Programming with JAVA (4341602)

IT-SEM 4-A 46 | P a g e
236170316008 Object Oriented Programming with JAVA (4341602)

Practical :- 12

➢ Develop a program for implementation of Wrapper Class to convert


primitive value into object (Boxing) and object into primitive value
(Unboxing).

Output:-

IT-SEM 4-A 47 | P a g e
236170316008 Object Oriented Programming with JAVA (4341602)

IT-SEM 4-A 48 | P a g e
236170316008 Object Oriented Programming with JAVA (4341602)

Practical :- 13
➢ Develop a program with a static block and show that it will be
executed before the main() method in a class.

Output:-

IT-SEM 4-A 49 | P a g e
236170316008 Object Oriented Programming with JAVA (4341602)

IT-SEM 4-A 50 | P a g e
236170316008 Object Oriented Programming with JAVA (4341602)

Practical :-14
➢ Develop a program to demonstrate use of static functions.

Output:-

IT-SEM 4-A 51 | P a g e
236170316008 Object Oriented Programming with JAVA (4341602)

IT-SEM 4-A 52 | P a g e
236170316008 Object Oriented Programming with JAVA (4341602)

Practical :- 15
➢ Develop a program to demonstrate use of ‘this’ keyword. Check
whether ‘this’ can access the private members of the class or not.

IT-SEM 4-A 53 | P a g e
236170316008 Object Oriented Programming with JAVA (4341602)

Output:-

IT-SEM 4-A 54 | P a g e
236170316008 Object Oriented Programming with JAVA (4341602)

IT-SEM 4-A 55 | P a g e
236170316008 Object Oriented Programming with JAVA (4341602)

Practical :- 16
➢ Develop a program with an overloaded constructor. Also develop the
copy constructor to create a new object with the state of the existing
object.

IT-SEM 4-A 56 | P a g e
236170316008 Object Oriented Programming with JAVA (4341602)

Output :-

IT-SEM 4-A 57 | P a g e
236170316008 Object Oriented Programming with JAVA (4341602)

IT-SEM 4-A 58 | P a g e
236170316008 Object Oriented Programming with JAVA (4341602)

Practical :- 17
➢ Develop a program to demonstrate the use of private constructor and
also write a method which will count the number of instances created
using default constructor only.

Output :-

IT-SEM 4-A 59 | P a g e
236170316008 Object Oriented Programming with JAVA (4341602)

IT-SEM 4-A 60 | P a g e
236170316008 Object Oriented Programming with JAVA (4341602)

PRACTICAL :- 18
➢ Develop a program to demonstrate single inheritance, multilevel inheritance,
and hierarchical inheritance.

INPUT:-

IT-SEM 4-A 61 | P a g e
236170316008 Object Oriented Programming with JAVA (4341602)

OUTOUT:-

IT-SEM 4-A 62 | P a g e
236170316008 Object Oriented Programming with JAVA (4341602)

IT-SEM 4-A 63 | P a g e
236170316008 Object Oriented Programming with JAVA (4341602)

PRACTICAL N0:-19
➢ Develop a program with one class named shape which has two
member functions named erase () and draw(). In the program we
have three other subclasses: circle, triangle and square. Override
methods of the super class into sub classes.

ZZZ

IT-SEM 4-A 64 | P a g e
236170316008 Object Oriented Programming with JAVA (4341602)

OUTPUT:-

IT-SEM 4-A 65 | P a g e
236170316008 Object Oriented Programming with JAVA (4341602)

IT-SEM 4-A 66 | P a g e
236170316008 Object Oriented Programming with JAVA (4341602)

PRACTICAL NO:-20
➢ Develop a program for implementation of Dynamic method dispatch.

INPUT:-

IT-SEM 4-A 67 | P a g e
236170316008 Object Oriented Programming with JAVA (4341602)

OUTPUT:-

IT-SEM 4-A 68 | P a g e
236170316008 Object Oriented Programming with JAVA (4341602)

IT-SEM 4-A 69 | P a g e
236170316008 Object Oriented Programming with JAVA (4341602)

PRACTICAL NO :-21
➢ Develop a java program that demonstrates the use of Abstract class.

INPUT:-

IT-SEM 4-A 70 | P a g e
236170316008 Object Oriented Programming with JAVA (4341602)

OUTPUT:-

IT-SEM 4-A 71 | P a g e
236170316008 Object Oriented Programming with JAVA (4341602)

IT-SEM 4-A 72 | P a g e
236170316008 Object Oriented Programming with JAVA (4341602)

PRACTICAL NO :-22
➢ Develop a java program that illustrates interface inheritance.
Interface ‘A1’ and ‘A2’ are extended from interface ‘A’. Interface
‘A12’ inherited from both ‘A1’ and ‘A2’. Each interface declares one
method and one constant. Class ‘Interface_Imple’ implements ‘A12’.
Instantiate ‘Interface_Imple’ and invoke each of its methods. Each
method displays one of the constants.

Input :-

IT-SEM 4-A 73 | P a g e
236170316008 Object Oriented Programming with JAVA (4341602)

IT-SEM 4-A 74 | P a g e
236170316008 Object Oriented Programming with JAVA (4341602)

Output :-

IT-SEM 4-A 75 | P a g e
236170316008 Object Oriented Programming with JAVA (4341602)

IT-SEM 4-A 76 | P a g e
236170316008 Object Oriented Programming with JAVA (4341602)

Practical no :- 23
➢ Develop a program to create a Package and demonstrate how
packages are used in java. and use java access modifier to
demonstrate the access rules in a package.

Input:-

IT-SEM 4-A 77 | P a g e
236170316008 Object Oriented Programming with JAVA (4341602)

Output:-

IT-SEM 4-A 78 | P a g e
236170316008 Object Oriented Programming with JAVA (4341602)

IT-SEM 4-A 79 | P a g e
236170316008 Object Oriented Programming with JAVA (4341602)

Practical no :-24

➢ Develop a program to demonstrate the use of ‘super’ and ‘final’


keywords.
Input :-

IT-SEM 4-A 80 | P a g e
236170316008 Object Oriented Programming with JAVA (4341602)

Output :-

IT-SEM 4-A 81 | P a g e
236170316008 Object Oriented Programming with JAVA (4341602)

IT-SEM 4-A 82 | P a g e
236170316008 Object Oriented Programming with JAVA (4341602)

Practical :-25

➢ Develop programs to demonstrate the use of Exception Handling


using predefined Exception Classes.

Input:-

IT-SEM 4-A 83 | P a g e
236170316008 Object Oriented Programming with JAVA (4341602)

Output :-

IT-SEM 4-A 84 | P a g e
236170316008 Object Oriented Programming with JAVA (4341602)

IT-SEM 4-A 85 | P a g e
236170316008 Object Oriented Programming with JAVA (4341602)

Practical :-26

➢ Develop a program to handle multiple exceptions using multiple try


blocks and multiple catch blocks.

Input:-

IT-SEM 4-A 86 | P a g e
236170316008 Object Oriented Programming with JAVA (4341602)

Output:-

IT-SEM 4-A 87 | P a g e
236170316008 Object Oriented Programming with JAVA (4341602)

IT-SEM 4-A 88 | P a g e
236170316008 Object Oriented Programming with JAVA (4341602)

Practical :- 27

➢ Develop a program to implement user defined exceptions.

Input:-

IT-SEM 4-A 89 | P a g e
236170316008 Object Oriented Programming with JAVA (4341602)

Output:-

IT-SEM 4-A 90 | P a g e
236170316008 Object Oriented Programming with JAVA (4341602)

IT-SEM 4-A 91 | P a g e
236170316008 Object Oriented Programming with JAVA (4341602)

Practical :-28
➢ Develop a program to demonstrate use of throw, throws, and finally
keyword.

Input :-

IT-SEM 4-A 92 | P a g e
236170316008 Object Oriented Programming with JAVA (4341602)

Output :-

IT-SEM 4-A 93 | P a g e
236170316008 Object Oriented Programming with JAVA (4341602)

IT-SEM 4-A 94 | P a g e
236170316008 Object Oriented Programming with JAVA (4341602)

Practical :-29
➢ Develop a program that executes two threads. One thread displays
“Java Programming” every 2 seconds, and the other displays
“Semester - 4th” every 5 seconds. (Create the threads by extending
the Thread class)

Input :-

IT-SEM 4-A 95 | P a g e
236170316008 Object Oriented Programming with JAVA (4341602)

Output :-

IT-SEM 4-A 96 | P a g e
236170316008 Object Oriented Programming with JAVA (4341602)

IT-SEM 4-A 97 | P a g e
236170316008 Object Oriented Programming with JAVA (4341602)

Practical :- 30
➢ Develop a program that executes two threads. One thread will print
the even numbers and another thread will print odd numbers between
1 to 10. (Create the thread by implementing runnable interface)

Input :-

IT-SEM 4-A 98 | P a g e
236170316008 Object Oriented Programming with JAVA (4341602)

Output :-

IT-SEM 4-A 99 | P a g e
236170316008 Object Oriented Programming with JAVA (4341602)

IT-SEM 4-A 100 | P a g e


236170316008 Object Oriented Programming with JAVA (4341602)

Practical :-31
➢ Develop a program to demonstrate use of synchronization of threads
when multiple threads are trying to update a common variable.

Input :-

IT-SEM 4-A 101 | P a g e


236170316008 Object Oriented Programming with JAVA (4341602)

Output :-

IT-SEM 4-A 102 | P a g e


236170316008 Object Oriented Programming with JAVA (4341602)

IT-SEM 4-A 103 | P a g e


236170316008 Object Oriented Programming with JAVA (4341602)

Practical :- 32
➢ Develop programs to create, write, modify, read operations on Text
files.

Input:-

IT-SEM 4-A 104 | P a g e


236170316008 Object Oriented Programming with JAVA (4341602)

Output :-

IT-SEM 4-A 105 | P a g e


236170316008 Object Oriented Programming with JAVA (4341602)

IT-SEM 4-A 106 | P a g e

You might also like