You are on page 1of 26

SIX WEEKS SUMMER TRAINING REPORT

ON

APPLICATION DEVELOPMENT IN JAVA

Submitted By

DANDU AJITH KUMAR

Registration No: 12002773

Program Name: B.Tech (C.S.E)

Under the guidance of

ARVIND KUMAR SIR (LPU)

School of Computer Science & Engineering

Lovely Professional University, Phagwara

(June-July 2022)

Page |1
DECLARATION

I hereby declare that I have completed my six weeks summer training at LOVELY

PROFESSIONAL UNIVERSITY, PHAGWARA from 25/05/2022 to 10/07/2022 under the

guidance of Arvind Kumar Sir. I hereby undertake that the project undertaken by me is the

genuine work of mine.

Date: 15-07-2022 Name of the Student: DANDU AJITH KUMAR

Registration Number: 12002773

Page |2
ACKNOWLEDGEMENT

It is my proud privilege and duty to acknowledge the kind of help and guidance received from several

people in preparation of this report. It would not have been possible to prepare this report in this form

without their valuable help, cooperation, and guidance.

First and foremost, I wish to record our sincere gratitude to Arvind Kumar for his constant

support and encouragement in preparation of this report and for making available videos and interface

facilities needed to prepare this report.

The seminar on “Application Development in Java” was very helpful to us in giving the

necessary background information and inspiration in choosing this topic for the seminar. His

contributions and technical support in preparing this report are greatly acknowledged.

Last but not the least, we wish to thank our parents for financing our studies in this college as well as for

constantly encouraging us to learn engineering. Their personal sacrifice in providing this opportunity to

learn engineering is gratefully acknowledged.

Thank You

DANDU AJITH KUMAR

Page |3
TABLE OF CONTENTS:

S. No. Title Page No.

1 Introduction 06-11

2 Technology Learnt 12-20

3 Projects 21-24

4 Learning Outcomes 25

5 Conclusion 26

6 References 27

TRAINING CERTIFICATE:
Till now not issued.

Page |4
INTRODUCTION

Java is an Object-Oriented Programming language but is not purely Object Oriented because it

uses primitive data types such as int, float, char etc. It’sfeatures like Portable and, Robust some

of the very important OOPS features, rendering this language unworthy of being called

completely Object Oriented. It is a middle level language.

Benefits of Java over C and C++Language

The major difference being OOPS concept, Java is an object-oriented language whereas C

language is a procedural language. Apart from this there are many other features of Java which

gives this language an upper hand on C and C++ language.

Following features of Java makes it a stronger language than C and C++,

1. There is Stronger Type Checking in Java.

2. All the OOPS features in Java like Abstraction, Encapsulation, Inheritance etc makes it

more worthy and useful for programmers.

3. Java supports and allows user defined operators (i.e. Operator Overloading) and

function overloading is also supported in it.

4. Exception Handling is there in Java.

5. The Concept of Virtual functions and Constructors for Objects.

6. Variables can be declared anywhere in the program in Java but must be declared

before they are used.

Page |5
What is JVM?

JVM (Java Virtual Machine) is an abstract machine that enables your computer to run a Java

program.

When you run the Java program, Java compiler first compiles your Java code to bytecode.

Then, the JVM translates bytecode into native machine code (set of instructions that a

computer's CPU executes directly).

Java is a platform-independent language. It's because when you write Java code, it's

ultimately written for JVM but not your physical machine (computer). Since JVM executes

the Java bytecode which is platform-independent, Java is platform-independent.

WORKING OF JAVA PROGRAM

What is JRE?

JRE (Java Runtime Environment) is a software package that provides Java class libraries,

Java Virtual Machine (JVM), and other components that are required to run Java

applications.

JRE is the superset of JVM.

Page |6
JAVA RUNTIME ENVIRONMENT

What is

JDK?

JDK (Java Development Kit) is a software development kit required to develop applications

in Java. When you download JDK, JRE is also downloaded with it.

In addition to JRE, JDK also contains a number of development tools (compilers, JavaDoc,

Java Debugger, etc).

RELATION BETWEEN JVM, JRE AND JDK

Page |7
Page |8
INSTALATION OF JDK?

If we do not have a copy of JDK installed on our computer, we need to open our Internet

Browser and go to the Python download page i.e.

https://www.oracle.com/java/technologies/downloads/

Now that we are on the download page, select which of the software builds we would like to

download. We can use the most updated version available

Once we have clicked on that, we will be taken to a page with a description of all the new

updates and features, however, we can always read that while the download is in process.

Scroll to the bottom of the page till we find the “Download” section and click on the link that

says, “download page.”

Page |9
At last, To confirm if everything is set up properly, open cmd and type java –version

After download, run the .exe file and follow the instructions to install Java on your

machine. Once you install Java on your machine, you have to set up the environment

variable.

Go to Control Panel -> System and Security -> System. Under the Advanced System

Setting option click on Environment Variables as highlighted below.

P a g e | 10
P a g e | 11
P a g e | 12
TECHNOLOGY LEARNT

VARIABLES IN JAVA?

A variable is a location in memory (storage area) to hold data.

Create Variables in Java:

Here's how we create a variable in Java,

int speedLimit = 80;

Here, speedLimit is a variable of int data type and we have assigned value 80 to it.

DATA TYPES IN JAVA?

Data types specify the different sizes and values that can be stored in the variable. There are

two types of data types in Java:

1. Primitive data types: The primitive data types include boolean, char, byte, short, int,

long, float and double.

2. Non-primitive data types: The non-primitive data types include Classes, Interfaces,

and Arrays.

P a g e | 13
Java Operators:

Operators are symbols that perform operations on variables and values. For example, + is an

operator used for addition, while * is also an operator used for multiplication. Operators in

Java can be classified into 5 types:

1. Arithmetic Operators

2. Assignment Operators

3. Relational Operators

4. Logical Operators

5. Unary Operators

6. Bitwise Operators

Java Arrays

An array is a collection of similar types of data.

For example, if we want to store the names of 100 people then we can create an array of the

string type that can store 100 names.

String [] array = new String [100];

P a g e | 14
Objects:

My name is Rahul, and I am an instance/object of class Male. When we say, Human

Being, Male or Female, we just mean a kind, you, your friend, me we are the forms of these

classes. We have a physical existence while a class is just a logical definition. We are the

object.

Object Oriented Programming in Java?

Object Oriented programming is a programming style that is associated with the concept of

Class, Objects and various other concepts revolving around these two, like Inheritance,

Polymorphism, Abstraction, Encapsulation Methods, file handling, etc.

Class:

Here we can take HumanBeing as a class. A class is a blueprint for any functional

entitywhich defines its properties and its functions. Like Human Being, having body

P a g e | 15
parts, and performing various actions.

Inheritance:

Considering HumanBeing a class, which has properties like hands, legs, eyes etc. and

functions like walk, talk, eat, see etc. Male and Female are also classes, but most of the

properties and functions are included in HumanBeing, hence they can inherit everything

from class HumanBeing using the concept of Inheritance.

Constructors:

Java constructors or constructors in Java is a terminology been used to construct something

in our programs. A constructor in Java is a special method that is used to initialize objects.

The constructor is called when an object of a class is created. It can be used to set initial

values for object attributes.

How Constructors are Different from Methods in Java?

Constructors must have the same name as the class within which it is defined while it is not

necessary for the method in Java.

Constructors do not return any type while method(s) have the return type or void if does not

return any value.

P a g e | 16
Constructors are called only once at the time of Object creation while method(s) can be

called any number of times.

Abstraction:

Abstraction means, showcasing only the required things to the outside world while

hiding thedetails. Continuing our example, Human Beings can talk, walk, hear, eat,

but the details arehidden from the outside world. We can take our skin as the

Abstraction factor in our case, hiding the inside mechanism.

Encapsulation:

This concept is a little tricky to explain with our example. Our Legs are binded to

help us walk. Our hands, help us hold things. This binding of the properties to

functions is calledEncapsulation.

Polymorphism:

Polymorphism is a concept, which allows us to redefine the way something works, by

eitherchanging how it is done or by changing the parts using which it is done. Both the

ways havedifferent terms for them.

If we walk using our hands, and not legs, here we will change the parts used to

performsomething. Hence this is called Overloading.

And if there is a defined way of walking, but I wish to walk differently, but using

my legs,like everyone else. Then I can walk like I want; this will be Overriding.

P a g e | 17
Interfaces in Java:

An Interface in Java programming language is defined as an abstract type used to specify

the behavior of a class. An interface in Java is a blueprint of a class. A Java interface

contains static constants and abstract methods.

The interface in Java is a mechanism to achieve abstraction. There can be only abstract

methods in the Java interface, not the method body. It is used to achieve abstraction

and multiple inheritance in Java. In other words, you can say that interfaces can have abstract

methods and variables. It cannot have a method body. Java Interface also represents the IS-

A relationship.

Syntax and Structure of Java program

Here we will discuss one simple and basic Java program to print "Hello this is Java"

and itsstructure in parts with details and uses.

Java "Hello, World!" Program

// Your First Program

P a g e | 18
class HelloWorld {

public static void main (String [] args) {

System.out.println("Hello, World!");

Output

Hello, World!

There is no header file in Java like C and C++.

In this we use packages as to give input we use

scanner.to get the output we use System.out.println.

P a g e | 19
MINI PROJECT:

I affirm that this program is entirely my own work and none of it is the work of

any other person.

Project Summary:

1.Temperature Converter:

Java Program to convert Fahrenheit to Celsius – Here we discuss the


various methods to convert the Fahrenheit temperature measurement to
Celsius temperature measurement and vice versa. The various methods include
Static Method, Switch Case, and the method. We have added the compiler to
each case with sample outputs citing specific examples.

The following program has been written in 4 Possible Ways:


• Static Method

• Using Method
• Fahrenheit to Celsius and Vice Versa Using Switch Case

• Celsius To Fahrenheit

Celsius Temperature Scale: Earlier known as the Centigrade Scale, the


Celsius Scale is a widely used one, also an SI derived unit for temperature. The
normal scale of a Celsius thermometer measures from 0°C (Water’s freezing
point at Standard Atmospheric Pressure) to 100°C (Water’s boiling point at
Standard Atmospheric Pressure)

Fahrenheit Temperature Scale: The Fahrenheit Scale is specifically used


in the U.S.A and few other places. The normal scale of a Fahrenheit
thermometer ranges from 32°F (Water’s freezing point at Std Atm Pressure)
and 212°F (Water’s boiling point at Std Atm Pressure).

P a g e | 20
The formula to convert Fahrenheit into Celsius:

Project Outcomes:

P a g e | 21
2.World Clock Application:

* The World Clock class is a subclass of the class Clock. It inherits some of the

method and variables from the class clock and uses . the methods getHours

and getMinutes to return the world clock time. The method getTime returns a

string with the hours and minutes by calling the getHours and getMinutes

methods. The constructor of the WorldClock class uses a time offset to

calculate the world clock from the time at our current location.

A simple World Clock application, accessible from the system tray. It shows the

time in the cities loaded from a configuration file.

This is a simple digital clock written in Java. This clock can display time and

date of any place in world. The time can be displayed in 12 hour or 24-hour

format. The foreground and background colours of the digits can be changed.

The clock can be wrapped with an ornamental frame as well .

P a g e | 22
P a g e | 23
LEARNING OUTCOMES

The learning objectives of this course are:

▪ To understand how Java improves C and C++ with object-oriented features.

▪ To learn how to write inline functions for efficiency and performance.

▪ To learn the syntax and semantics of the Java programming language.

▪ To learn how to design Java classes for code reuse.

▪ To learn how to implement copy constructors and class member functions.

▪ To understand the concept of data abstraction and encapsulation.

▪ To learn how to overload functions and operators in C++.

▪ To learn how containment and inheritance promote code reuse in Java.

▪ To learn how inheritance and virtual functions implement dynamic

binding withpolymorphism.

▪ To learn how to design and implement generic classes with Java templates.

▪ To learn how to use exception handling and file handling in Java programs

P a g e | 24
Conclusion:

All the above was part of my training during my summer break I specially choose the Java by

LPU Pvt Ltd for reasons stated below:

Java is considered one of the most powerful programming languages. It empowers developers

to have control over the way they utilize resources. Its ability and speed clearly distinguish

this language from other programming languages. Due to high performance, Java language is

often used to develop various game engines, desktop applications, and games, and it is

platform independent.

Helps You Learn Other Advanced Programming Languages

It had video lectures of all the topics from which one can easily learn. I prefer learning from

video rather than books and notes. I know books and notes and thesis have their own

significance but still video lecture or face to face lectures make it easy to understand faster as

we are involved Practically

It had track based learning and weekly assessment to test my skills

It was a great opportunity for me to invest my time in learning instead of wasting it here and

there during my summer break.

It contained a lot of knowledge for such a reasonable price.

P a g e | 25
References:

• https://www.oracle.com/java/technologies/downloads/

• https://www.eclipse.org/\

• https://www.programiz.com/java-programming

• https://www.geeksforgeeks.org/java/?ref=shm

• https://www.w3schools.com/java/default.asp

THANK YOU

P a g e | 26

You might also like