Professional Documents
Culture Documents
Core Java Journal
Core Java Journal
CERTIFICATE
This is certified to be a bonafide record of practical works done by the above student in the
college laboratory for the course Core Java (Course Code:2131UISCJ) for the partial fulfilment of
Third Semester of BSc IT during the academic year 2021-22.
The journal work is the original study work that has been duly approved in the year 2021-22
by the undersigned.
_____________________ ____________________
External Examiner (Ms.Niramaye Deshpande)
(Subject-In-Charge)
3 15-7-21 16 – 18
Use of Control statements and Iterators :
5 5-8-21 Inheritance : 23 – 30
6 12-8-21 Polymorphism : 31 - 33
a. Write a java program to implement method
overloading.
b. Write a java program to implement method
overriding.
8 2-9-21 Arrays : 36 – 38
a. Sorting Array elements in Ascending order.
b. Sorting Array elements in descending order.
11 23-9-21 AWT : 45 – 54
a. Design an AWT application that contains the
interface to add student information and display
the same.
b. Design a calculator based on AWT application.
Name: Vansh Nagda Roll no.: 381 Class: SYIT
Theory:- Data types specify the different sizes and values that can be stored
in the variable. There are two types of data types in Java:
Primitive data types: In Java language, primitive data types are the building
blocks of data manipulation. These are the most basic data types available in
Java Language The primitive data types include boolean, char, byte, short, int,
long, float and double.
Code: -
Name: Vansh Nagda Roll no.: 381 Class: SYIT
Output: -
Aim :- B. Write a program to accept integer values for a, b and c which are
coefficients of quadratic equation and find the solution of quadratic equation.
Code: -
Name: Vansh Nagda Roll no.: 381 Class: SYIT
Name: Vansh Nagda Roll no.: 381 Class: SYIT
Output: -
Name: Vansh Nagda Roll no.: 381 Class: SYIT
1. Arithmetic operator :-
Code: -
Output: -
Name: Vansh Nagda Roll no.: 381 Class: SYIT
2. Relational Operator :-
Output: -
Code: -
Name: Vansh Nagda Roll no.: 381 Class: SYIT
Output: -
4. Conditional Operator :-
&& Conditional-AND ||
Conditional-OR
Name: Vansh Nagda Roll no.: 381 Class: SYIT
Code: -
Output: -
5. Instanceof operator :-
Theory:- The instance of operator compares an object to a specified type. You can use it to
test if an object is an instance of a class, an instance of a subclass, or an instance of a class
that implements a particular interface.
Code: -
Name: Vansh Nagda Roll no.: 381 Class: SYIT
Output: -
Code: -
Output: -
Output :-
Theory:- Java compiler executes the code from top to bottom. The statements
in the code are executed according to the order in which they appear.
However, Java provides statements that can be used to control the flow of
Java code. Such statements are called control flow statements. It is one of the
fundamental features of Java, which provides a smooth flow of program.
Java provides three types of control flow statements.
Name: Vansh Nagda Roll no.: 381 Class: SYIT
Code: -
Output: -
Name: Vansh Nagda Roll no.: 381 Class: SYIT
Code: -
Name: Vansh Nagda Roll no.: 381 Class: SYIT
Output: -
An entity that has state and behavior is known as an object e.g., chair, bike,
marker, pen, table, car, etc. It can be physical or logical. Basically, it is an
instance of a class.
Instance method are methods which require an object of its class to be created
before it can be called. To invoke a instance method, we have to create an
Object of the class in within which it defined.
Code: -
Name: Vansh Nagda Roll no.: 381 Class: SYIT
Output: -
Code: -
Name: Vansh Nagda Roll no.: 381 Class: SYIT
Output :-
Name: Vansh Nagda Roll no.: 381 Class: SYIT
Practical 5 :- Inheritance
Output: -
Name: Vansh Nagda Roll no.: 381 Class: SYIT
Code :-
Output :-
Name: Vansh Nagda Roll no.: 381 Class: SYIT
Code :
Name: Vansh Nagda Roll no.: 381 Class: SYIT
Output :-
Name: Vansh Nagda Roll no.: 381 Class: SYIT
Theory:- More than one derived class extends a single base class. In
simple words, more than one child class extends a single parent class or a
single parent class has more than one child class.
Code :-
Name: Vansh Nagda Roll no.: 381 Class: SYIT
Output: -
Practical 6 :- Polymorphism
Aim: - A. Write a java program to implement method overloading.
Theory: - If a class has multiple methods having same name but different in
Name: Vansh Nagda Roll no.: 381 Class: SYIT
parameters.
Name: Vansh Nagda Roll no.: 381 Class: SYIT
Output :-
Name: Vansh Nagda Roll no.: 381 Class: SYIT
Code:
Output :-
Name: Vansh Nagda Roll no.: 381 Class: SYIT
Code :-
Output :-
Name: Vansh Nagda Roll no.: 381 Class: SYIT
Practical 8 :- Arrays
Aim :- A. Sorting Array elements in Ascending order.
Theory:- In this program, we need to sort the given array in ascending order
such that elements will be arranged from smallest to largest. This can be
achieved through two loops. The outer loop will select an element, and inner
loop allows us to compare selected element with rest of the elements.
Code: -
Output :-
Name: Vansh Nagda Roll no.: 381 Class: SYIT
Code :-
Name: Vansh Nagda Roll no.: 381 Class: SYIT
Output :-
Code :-
Output :-
Name: Vansh Nagda Roll no.: 381 Class: SYIT
Aim :- B. Demonstrating the use of try catch and finally block to create and handle .
Theory:- Exception handling is one that allows us to handle the runtime errors
caused by exceptions. If an exception occurs, which has not been handled by
programmer then program execution gets terminated and a system generated
error message is shown to the user. This message is not user friendly so a user
will not be able to understand what went wrong. In order to let them know the
reason in simple language, we handle exceptions.
Code :-
Output :-
Name: Vansh Nagda Roll no.: 381 Class: SYIT
Theory :-
BufferedReader :- The BufferedReader class of Java is used to read the stream
of characters from the specified source. This class provides a method named
read() and readLine() which reads and returns the character and next line from
the source (respectively) and returns them.
Scanner :- Scanner is a class in java.util package used for obtaining the input of
the primitive types like int, double, etc. and strings. It is the easiest way to read
input in a Java program. java util package can be imported without downloading
any external libraries. Scanner reads text from standard input and returns it to a
program.
Code :-
Name: Vansh Nagda Roll no.: 381 Class: SYIT
Output :-
Name: Vansh Nagda Roll no.: 381 Class: SYIT
Practical 11 :- AWT
Output :-
Code :-
Name: Vansh Nagda Roll no.: 381 Class: SYIT
Name: Vansh Nagda Roll no.: 381 Class: SYIT
Name: Vansh Nagda Roll no.: 381 Class: SYIT
Name: Vansh Nagda Roll no.: 381 Class: SYIT
Output :-
Output of 7 * 2
Name: Vansh Nagda Roll no.: 381 Class: SYIT