0% found this document useful (0 votes)
84 views

Programming - in - JavaLabmanual CIC 258

The document provides information about a lab file for a programming in Java course. It includes the lab objectives, course outcomes, and a list of 12 experiments to be completed as part of the course. The experiments cover topics like basic Java concepts, control statements, arrays, methods, classes, inheritance, polymorphism, abstract classes, interfaces, and packages.

Uploaded by

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

Programming - in - JavaLabmanual CIC 258

The document provides information about a lab file for a programming in Java course. It includes the lab objectives, course outcomes, and a list of 12 experiments to be completed as part of the course. The experiments cover topics like basic Java concepts, control statements, arrays, methods, classes, inheritance, polymorphism, abstract classes, interfaces, and packages.

Uploaded by

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

LAB FILE

PROGRAMMING IN JAVA
CIC-258

Faculty name : Dr. Sandeep Tayal Student name :


Roll No.:
Semester :
Group :

Department Of Computer Science & Engineering


Maharaja Agrasen Institute of Technology, PSP area, Sector – 22, Rohini,
New Delhi – 110085
(Affiliated to Guru Gobind Singh Indraprastha University, New Delhi)

2023
MAHARAJA AGRASEN INSTITUTE OF TECHNOLOGY
VISION

To nurture young minds in a learning environment of high academic value and imbibe spiritual and ethical
values with technological and management competence.

MISSION
The Institute shall endeavor to incorporate the following basic missions in the teaching methodology:

Engineering Hardware – Software Symbiosis

Practical exercises in all Engineering and Management disciplines shall be carried out by Hardware
equipment as well as the related software enabling deeper understanding of basic concepts and
encouraging inquisitive nature.

Life – Long Learning

The Institute strives to match technological advancements and encourage students to keep updating their
knowledge for enhancing their skills and inculcating their habit of continuous learning.

Liberalization and Globalization

The Institute endeavors to enhance technical and management skills of students so that they are intellectually
capable and competent professionals with Industrial Aptitude to face the challenges of globalization.

Diversification

The Engineering, Technology and Management disciplines have diverse fields of studies with different
attributes. The aim is to create a synergy of the above attributes by encouraging analytical thinking.

Digitization of Learning Processes

The Institute provides seamless opportunities for innovative learning in all Engineering and Management
disciplines through digitization of learning processes using analysis, synthesis, simulation, graphics,
tutorials and related tools to create a platform for multi-disciplinary approach.

Entrepreneurship

The Institute strives to develop potential Engineers and Managers by enhancing their skills and research
capabilities so that they become successful entrepreneurs and responsible citizens.
MAHARAJA AGRASEN INSTITUTE OF TECHNOLOGY
COMPUTER SCIENCE & ENGINEERING DEPARTMENT

VISION
“To be centre of excellence in education, research and technology transfer in the
field of computer engineering and promote entrepreneurship and ethical values.”

MISSION
“To foster an open, multidisciplinary and highly collaborative research
environment to produce world-class engineers capable of providing innovative
solutions to real life problems and fulfill societal needs.”
INTRODUCTION TO THE LAB

Lab Objective
The goal of this course is to provide students with the ability to write programs in Java and
apply concepts described in the Object-Oriented Programming course. Java as a class-based
and pure OOP language is used to demonstrate and implement appropriate concepts and
techniques. The students are exposed to the concepts, fundamental syntax, and the thought
processes behind object-oriented programming. By the end of course students will acquire
the basic knowledge and skills necessary to implement object-oriented programming
techniques in software development in Java. Each practical class will culminate in an
assessed exercise.

Course Outcomes
On successful completion of this Course, students should be able to:
LIST OF EXPERIMENTS (As prescribed by GGSIPU)
S.NO. Topics
List of Experiments
Covered
1. Write a Program to accept a
String as a command-line
argument and print a Welcome
Basic concept of message as given below:-
Java programming, “Welcome yourname”.
Compilation and 2. Program to find ASCII code of
LAB 1 Execution Process, a character
Data Types, operators, 3. Write a Program to accept two
Reading user input, integers as inputs and print
Strings their sum.
4. Swapping two numbers using
bitwise operator

1. Initialize two-character variables in a


program and display the characters in
alphabetical order.
2. Write a program to receive a colour code
from the user (an Alphabet).
3. Write a program to print even numbers
LAB 2 between 23 and 57. Each number should
Java Control be printed in a separate row.
statements, 4. Write a program to print * in Floyd's
Command line format (using for and while loop).
arguments 5. Write a Java program to find if the given
number is palindrome or not.

1. Initialize an integer array with ASCII


values and print the corresponding
character values in a single row.
2. Write a program to reverse the elements
of a given 2*2 array. Four integer
numbers need to be passed as Command-
Line arguments
Arrays, Methods, 3. Create a java program to implement stack
LAB 3 and queue concept.
Method Overloading
4. Write a java program to produce the
tokens from given long string.
5. Using the concept of method overloading
Write method for calculating the area of
triangle, circle and rectangle.
Classes & 1. Create a class Box that uses a
LAB 4 object parameterized constructor to initialize the
Constructor dimensions of a box. The dimensions of
the Box are width, height, depth. The
class should have a method that can
return the volume of the box. Create an
object of the Box class and test the
functionalities.
2. WAP to display the use of this keyword.
3. Write a program that can count the
number of instances created for the class.
4. Java Program to get the cube of a given
number using the static method.

1. WAP that implements method overriding


Inheritance , 2. WAP to illustrate simple inheritance.
Polymorphism 3. WAP to illustrate multilevel inheritance.
LAB 5 , 4. WAP illustrating all uses of super
Method keywords
overriding 5. WAP to show dynamic polymorphism
and interface
1. Create an abstract class shape. Let
rectangle and triangle inherit this shape
class. Add necessary functions.
2. Write a java package to show dynamic
polymorphism and interfaces.
3. Write an application that creates an
‘interface’ and implements it.
4. Write an interface called Playable, with a
method void play();Let this interface be
placed in a package called music. Write a
class called Veena which implements
Playable interface. Let this class be
LAB 6 Abstract
placed in a package music.string .Write a
classes , class called Saxophone which implements
Interface, Playable interface. Let this class be
Package placed in a package music.wind .Write
another class Test in a package called
live. Then, (a). Create an instance of
Veena and call play() method (b). Create
an instance of Saxophone and call play()
method (c). Place the above instances in a
variable of type Playable and then call
play()
1. Write a program to accept name and age
of a person from the command
prompt(passed as arguments when you
execute the class) and ensure that the age
entered is >=15 and < 60.Display proper
error messages. The program must exit
gracefully after displaying the error
Exception message in case the arguments passed are
Handling, not proper. (Hint : Create a user defined
Applet exception class for handling errors.)
LAB 7 2. Create a customized exception and also
make use of all the 5 exception keywords.
3. Write an Applet that displays “Hello
World” (Background color-black, text
color-blue and your name in the status
window.)
4. Develop an analog clock using applet.
Multithreading 1. Write a java program to show
LAB 8 multithreaded producer and consumer
application.
2. Write an application that executes two
threads. One thread displays “An” every
1000 milliseconds and other displays “B”
every 3000 milliseconds. Create the
threads by extending the Thread class..
3. Create class of SalesPersons as a thread
that will display fives sales persons
name.Create a class as Days as other
Thread that has array of seven days.Call
the instance of SalesPersons in Days and
start both the threads ,suspend
SalesPersons on Sunday and resume on
wednesday Note: use suspend, resume
methods from thread
1. WAP that illustrates how to process
mouse click, enter, exit, press and release
AWT
events. The background color changes
Components
LAB 9 when the mouse is entered, clicked,
Event
pressed, released or exited.
Handling
2. WAP that displays your name whenever
the mouse is clicked.
1. Write a program that read from a file and
write to file.
2. Convert the content of a given file into
LAB 10 the uppercase content of the same file.
File Handling,
JDBC JDBC (Database connectivity with MS-
Access)
1. Create runnable jar file in java.
2. Develop Scientific Calculator using
Swing.
Swing 3. Display the digital watch in swing
LAB 11 tutorial.
4. Create an editor like MS-Word using
Swing.
1. Write a servlet to display “My first
servlet program” on browser.
2. Create a servlet that prints all the request
headers it receives, along with their
associated values.
3. Write a servlet to show all the parameters
sent to the servlet via either GET or
POST .
Servlet 4. Create a servlet that uses Cookies to store
LAB 12 the number of times a user has visited
your servlet.
5. Create a servlet that recognizes visitor for
the first time to a web application and
responds by saying “Welcome, you are
visiting for the first time”. When the page
is visited for the second time ,it should
say “Welcome Back”.
Programming In Java
PRACTICAL RECORD
Paper Code :- CIC-258
Name of Student :-
University Roll No. :-
Branch :-
Section/ Group :-

Index
S.No Experiment Marks Total Date of Date of Signature
Marks Performance Checking
R1 R2 R3 R4 R5
1

10

11

12

13

14

15

16

17

18
19

20

21

22

23

24

25

26

27

28

29

30

You might also like