Lab Manual AL406 Java
Lab Manual AL406 Java
Lab Manual
SEM : 4th [EVEN]
Faculty Details
Course Details
INDEX........................................................................................................................................................................... 2
PROGRAM OUTCOMES................................................................................................................................................. 6
PROGRAM OUTCOMES.............................................................................................................................................................6
COURSE OUTCOMES..................................................................................................................................................... 7
EXPERIMENT 1............................................................................................................................................................ 13
EXPERIMENT 2............................................................................................................................................................ 14
EXPERIMENT 3............................................................................................................................................................ 15
EXPERIMENT 4............................................................................................................................................................ 16
EXPERIMENT 5............................................................................................................................................................ 17
EXPERIMENT 6............................................................................................................................................................ 18
EXPERIMENT 7............................................................................................................................................................ 19
EXPERIMENT 8............................................................................................................................................................ 20
EXPERIMENT 9............................................................................................................................................................ 21
EXPERIMENT 10.......................................................................................................................................................... 22
EXPERIMENT 11.......................................................................................................................................................... 23
EXPERIMENT 12.......................................................................................................................................................... 24
EXPERIMENT 13.......................................................................................................................................................... 25
EXPERIMENT 14.......................................................................................................................................................... 26
Vision of Institute:
Initially to seek autonomy and eventually grow the Institute into a renowned University by:
Imparting the best technical and professional education to the students of the Institute.
Developing all the Departments of the Institute as Centers of Excellence.
Creating the most congenial and cordial environment of Teaching, Learning and Research in the
Institute.
Conceiving world - class Education, Ethics and Employability for students in global perspective.
Mission of Institute
To explore and ensure the best environment to transform students into creative, knowledgeable,
principled engineers and managers compatible with their abilities in ever-changing socio-economic and
competitive scenario by:
Vision
Mission
To impart knowledge in the state of art in Computer science & Management with relevant
theoretical basics.
To impart Quality education through well designed curriculum in tune with challenging
Software needs of the industry.
To facilitate the development of academic-industry Collaboration.
Write a program that accepts two numbers from the user and print their sum.
Write a program to calculate addition of two number using prototyping of methods.
Program to demonstrate function overloading for calculation of average.
Program to demonstrating overloaded constructor for calculating box volume.
Program to show the detail of students using concept of inheritance.
Program to demonstrate package concept.
Program to demonstrate implementation of an interface which contains two methods declaration
square and cube.
Program to demonstrate exception handling in case of division by zero error.
Program to demonstrate multithreading.
Program to demonstrate JDBC concept using create a GUI based application for student information.
Program to display “Hello World” in web browser using applet.
Program to add user controls to applets.
Write a program to create an application using concept of swing.
Program to demonstrate student registration functionality using servlets with session management.
To enrich graduates with the core competencies necessary for applying knowledge of
computer science and Data analytics tools to store, retrieve, implement and analyze
data in the context of business enterprise
To equip the graduates with entrepreneurial skills and qualities which help them to
perceive the functioning of business, diagnose business problems, explore the
entrepreneurial opportunities and prepare them to manage business efficiently.
Program Outcomes
1. Engineering knowledge: Apply the knowledge of mathematics, science, engineering fundamentals,
and an engineering specialization for the solution of complex engineering problems.
2. Problem analysis: Identify, formulate, research literature, and analyze complex engineering problems
reaching substantiated conclusions using first principles of mathematics, natural sciences, and
engineering sciences.
3. Design/development of solutions: Design solutions for complex engineering problems and design
system components or processes that meet the specified needs with appropriate consideration for public
health and safety, and cultural, societal, and environmental considerations.
4. Conduct investigations of complex problems: Use research based knowledge and research methods
including design of experiments, analysis and interpretation of data, and synthesis of information to
provide valid conclusions.
5. Modern tool usage: Create, select, and apply appropriate techniques, resources, and modern
engineering and IT tools, including prediction and modeling to complex engineering activities, with an
understanding of the limitations.
6. The engineer and society: Apply reasoning informed by the contextual knowledge to assess societal,
health, safety, legal and cultural issues and the consequent responsibilities relevant to the professional
engineering practice.
7. Environment and sustainability: Understand the impact of the professional engineering solutions in
societal and environmental contexts, and demonstrate the knowledge of, and need for sustainable
development.
8. Ethics: Apply ethical principles and commit to professional ethics and responsibilities and norms of
the engineering practice.
9. Individual and team work: Function effectively as an individual, and as a member or leader in
diverse teams, and in multidisciplinary settings.
10. Communication: Communicate effectively on complex engineering activities with the engineering
community and with the society at large, such as, being able to comprehend and write effective reports
and design documentation, make effective presentations, and give and receive clear instructions.
11. Project management and finance: Demonstrate knowledge and understanding of the engineering
and management principles and apply these to one’s own work, as a member and leader in a team, to
manage projects and in multidisciplinary environments.
12. Life-long learning: Recognize the need for and have the preparation and ability to engage in
independent and life-long learning in the broadest context of technological change.
COURSE OUTCOMES
CO1 Once the student has successfully completed this course, he/she will be able to:
Course Objectives:
Unit 1.
Overview of Java, Installation, First Simple Program, Compilation process, Java Keywords, Identifiers,
Literals, Comments, Data Types, Variables, Dynamic initialization, type conversion and casting, Operators,
Control Statements.
Unit 2.
Declaring Objects, Introducing Methods, Constructors, this Keyword, Garbage Collection, finalize Method,
Overloading Methods, Overloading Constructors, Using Objects as Parameters, Inheritance, Creating a
Multilevel Hierarchy, Packages and Interfaces, Exception Handling, Multithreading
Unit 3.
The Applet Class: Applet Basics, The Applet Class, Applet Architecture, Applet Initialization and
Termination , Simple Applet Display Methods, Simple Banner Applet, Using the Status Window, The
HTML APPLET Tag, Passing Parameters to Applets, Improving the Banner Applet.
Unit 4.
Introducing the AWT: Working with Windows, Graphics, and Text, AWT Classes, Window Fundamentals,
Component, Container, Panel, Frame, Working with Frame Windows, Handling Events in a Frame
Window, AWT Controls, Layout Managers, and Menus, Adding and Removing Controls, Grid Layout,
Border Layout, introduction to swing and servlet.
Unit 5.
Event Handling, Two Event Handling Mechanisms, The Delegation Event Model, Events, Event Sources,
Event Listeners, Event Classes, The Mouse Event Class and others, JDBC: JDBCODBC Bridge, the
connectivity model, the driver manager, navigating the resultset object contents, the JDBC exceptional
classes, connecting to remote database.
Reference Books:
1. E. Balagurusamy, “Programming with java A Primer”, McGrawHill.
2. Sharanam Shah, “ Core Java 8 for Beginners”, Shroff Publisher.
3. Naughton &Schildt, “The Complete Reference Java 2”, Tata McGraw Hill.
4. Horstmann& Cornell, “Core Java 2” (Vol I &II ), Pearson.
(1) Empowering Graduates will Graduates will Graduates will adapt Graduates will
students with the state of practice their work as teams on in their profession pursue advanced
the art facilities and profession with multidisciplinary with social study and
knowledge for the confidence and projects with awareness, ethics and research.
welfare of the society global effective responsibility.
and the nation. competitiveness communication
and make skills and
(2) Prepare students as intellectual leadership
per the ever-changing contributions to it. qualities.
need of the industry.
√ √
Quality education
√ √
Professional career √ √ √ √
Higher education √ √
Research √ √
Lifelong learning √ √
Sr. Course
N Outcome PO1 PO2 PO3 PO4 PO5 PO6 PO7 PO8 PO9 PO10 PO11 PO12
o
1 CO 1 H - M - M - - - - - - -
2 CO 2 H - M - M - - - L - M -
3 CO 3 H - M - H - - - - - - -
4 CO 4 H M M - M - - H - - - -
5 CO 5 H - M - H - - - - - M -
CO1.Write, compile, and execute Java programs that may include basic data types and control flow
constructs using J2SE or other Integrated Development Environments (IDEs) such as Eclipse, NetBeans,
and JDeveloper.
CO2. Write, compile and execute Java programs using object oriented class structures with parameters,
constructors, and utility and calculations methods, including inheritance, test classes and exception
handling.
CO3.Write, compile, and execute Java programs using various Collection classes.
CO4. Write, compile, and execute Java programs manipulating Strings and text documents.
CO5. Write, compile, execute Java programs that include GUIs and event driven programming. ()
Course Outcomes
Program Specific Outcomes
1 2 3 4 5
1 L H H L L
2 - - L - -
3 - - - L -
Batch A Batch B
Completi Completi
S. Name of Mappi Type Catego CO PO PSO on on Sig
N Experiment ng of Exp. ry Mappi Mappin Mappi n
o. with ng g ng
Unit
Write a program that accepts two numbers from the user and print their
sum.
import java.util.Scanner;
class Test
{ public static void main(String args[])
{ Scanner input = new Scanner(System.in);
int x, y, z;
z = x + y ;
z = sum(x,y) ;
class Box {
double l, b, h;
Box(double x) {
l = b = h = x;
}
Box(double x, double y) {
l = b = x;
h = y;
}
void volume() {
System.out.println("Volume of Box " + l * b * h);
}
}
class Person {
String name = new String();
String fname = new String();
String add = new String();
String phno = new String();
void display() {
System.out.println("Name is " + name);
System.out.println("Address " + add);
System.out.println("Father's Name is " + fname);
System.out.println("Contact number " + phno);
}
}
void display2() {
super.display();
System.out.println("Roll Number=" + roll);
interface Shape {
void square(int x);
void cube(int x);
}
import java.util.Scanner;
class Exp08 {
public static void main(String args[]) {
Scanner input = new Scanner(System.in);
int x,y,z;
try{
System.out.print("Enter first number : ");
x = input.nextInt();
System.out.print("Enter second number : ");
y = input.nextInt();
z = x / y ;
System.out.println(x + " / " + y + " = " + z);
}catch(ArithmeticException ae){
System.out.println("Can't Divide by Zero");
}
}
}
class Exp09{
public static void main(String args[]){
Simple1 t1=new Simple1();
Simple2 t2=new Simple2();
t1.start();
t2.start();
}
}
import java.sql.*;
public class FirstExample {
static final String DB_URL = "jdbc:mysql://localhost/MyDB";
static final String USER = "root";
static final String PASS = "root";
static String QUERY;
QUERY = "SELECT id, first, last, age FROM Employees";
Prerequisite:
Solution :
Program 1 :
Program 2.