0% found this document useful (0 votes)
1 views29 pages

Advance Java Lab Assignment

The document outlines an internal assignment for an Advanced Java Programming Laboratory, detailing various programming tasks for a student named Abhishek Rawat. It includes creating Java classes, demonstrating method and constructor overloading, string operations, inheritance, method overriding, exception handling, I/O streams, and Java Servlet programs. Each program is accompanied by expected outputs and serves as a practical application of Java concepts.

Uploaded by

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

Advance Java Lab Assignment

The document outlines an internal assignment for an Advanced Java Programming Laboratory, detailing various programming tasks for a student named Abhishek Rawat. It includes creating Java classes, demonstrating method and constructor overloading, string operations, inheritance, method overriding, exception handling, I/O streams, and Java Servlet programs. Each program is accompanied by expected outputs and serves as a practical application of Java concepts.

Uploaded by

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

________________________________________________________________________________

INTERNAL ASSIGNMENT
ON
ADVANCED JAVA PROGRAMMING
LABORATORY

Name of student: Abhishek Rawat


Student ID: 2520020123
Enrolment No.: N2MC2510193
Roll No.: 2225110193
Email: 2520020123@[Link]
Programme Name: MCA Semester: 2nd Semester
Subject Code: PMC202
Academic Year: 2026-2027
Program 1a:
Create a Java class “Employee” with the attributes – employee number, name, designation,
and salary.
a) Implement methods to set and display these attributes

_________________________________________________________________________
PMC202 – Advanced Java Programming Laboratory Page 1
Output 1a:

__________________________________________________________________________
PMC202 – Advanced Java Programming Laboratory Page 2
Program 1b:
b) Implement parameterized constructors for initializing these attributes.
Use "this" keyword to illustrate the difference between instance variable and constructor
parameters. Display these attributes.

__________________________________________________________________________
PMC202 – Advanced Java Programming Laboratory Page 3
Output 1b:

__________________________________________________________________________
PMC202 – Advanced Java Programming Laboratory Page 4
Program 2:
Write a Java program to demonstrate method overloading and constructor overloading.

Output 2:

__________________________________________________________________________
PMC202 – Advanced Java Programming Laboratory Page 5
Program 3a:
Write a Java program to perform the following operations on a string.
a) Count the number of characters and digits.

Output 3a:

__________________________________________________________________________
PMC202 – Advanced Java Programming Laboratory Page 6
Program 3b:
b) Check whether the given string is palindrome or not.

Output 3b Given string is a Palindrome

__________________________________________________________________________
PMC202 – Advanced Java Programming Laboratory Page 7
Output 3b Given string is not a Palindrome

__________________________________________________________________________
PMC202 – Advanced Java Programming Laboratory Page 8
Program 4:
Write a Java program to demonstrate single and multi-level inheritance. Display the order of
execution of constructors in multi-level inheritance.

__________________________________________________________________________
PMC202 – Advanced Java Programming Laboratory Page 9
Output of program 4:

__________________________________________________________________________
PMC202 – Advanced Java Programming Laboratory Page 10
Program 5:
Write a Java program to demonstrate method overriding.

Output of program 5:

__________________________________________________________________________
PMC202 – Advanced Java Programming Laboratory Page 11
Program 6a:
Write a Java program to illustrate the use of
a) Abstract class

Output of program 6a:

_________________________________________________________________________
PMC202 – Advanced Java Programming Laboratory Page 12
Program 6b:
Interfaces in Java

Output of program 6b:

__________________________________________________________________________
PMC202 – Advanced Java Programming Laboratory Page 13
Program 7:
Write a Java program to demonstrate exception handling. Show the order of execution of
"try", "catch" and "finally" blocks when an exception occurs and when it does not occur
during the execution by providing appropriate inputs during execution and displaying
messages.

_________________________________________________________________________
PMC202 – Advanced Java Programming Laboratory Page 14
Output of program 7: Array out of Bounds Exception Raised

Output of program 7: Divide by Zero ArithmeticException

__________________________________________________________________________
PMC202 – Advanced Java Programming Laboratory Page 15
Program 8:
Write a Java program to illustrate the use of I/O streams.

__________________________________________________________________________
PMC202 – Advanced Java Programming Laboratory Page 16
Output of program 8:

__________________________________________________________________________
PMC202 – Advanced Java Programming Laboratory Page 17
Program 9:
Write a Java Servlet program to implement a dynamic HTML using Servlet(Student name
and enrolment number should be accepted using HTML and displayed using a Servlet).

__________________________________________________________________________
PMC202 – Advanced Java Programming Laboratory Page 18
__________________________________________________________________________
PMC202 – Advanced Java Programming Laboratory Page 19
Output of program 9: [Link]

Output of program 9: [Link]

__________________________________________________________________________
PMC202 – Advanced Java Programming Laboratory Page 20
Program 10:
Write a Java Servlet program to demonstrate the use of cookies.

__________________________________________________________________________
PMC202 – Advanced Java Programming Laboratory Page 21
Output of program 10: [Link]

Output of program 10:

__________________________________________________________________________
PMC202 – Advanced Java Programming Laboratory Page 22
Program 11:
Write a Java Servlet program to demonstrate the use of GET and POST methods for
handling HTTP client requests and server responses.

__________________________________________________________________________
PMC202 – Advanced Java Programming Laboratory Page 23
__________________________________________________________________________
PMC202 – Advanced Java Programming Laboratory Page 24
Output of program 11: [Link]

Output of program 11:

__________________________________________________________________________
PMC202 – Advanced Java Programming Laboratory Page 25
Program 12:
12. Write a JSP program to demonstrate the use of Java Beans.

__________________________________________________________________________
PMC202 – Advanced Java Programming Laboratory Page 26
__________________________________________________________________________
PMC202 – Advanced Java Programming Laboratory Page 27
Output of program 11: [Link]

Output of program 11: [Link]

__________________________________________________________________________
PMC202 – Advanced Java Programming Laboratory Page 28

You might also like