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

Java project

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

Java project

Project report
Copyright
© © All Rights Reserved
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 24

A

INDUSTRIAL TRAINING

REPORT

ON
Submitted by
JAVA PROGRAMMING
VIVEK BUDANIA
21EBKCS116 INTERNSHIP

Organization Submitted in partial fulfillment for the Degree of


CodSoft
B.Tech
Place: - ONLINE
in

Computer Science & Engineering

Session - 2024

2024
DEPARTMENT OF COMPUTER SCIENCE & ENGINEERING
B.K. BIRLA INSTITUTE OF ENGINEERING &TECHNOLOGY
PILANI - 333 031 (RAJ)
(Affiliated to Bikaner Technical University, Bikaner)
Acknowledgement

I would like to acknowledge the contributions of the following people without whose
help and guidance this report would not have been completed.

I am also thankful to Prof. (Dr.) Nimish Kumar, H.O.D of Computer


Science Engineering Department, Institute of Technology & Management, Pilani
for his constant encouragement, valuable suggestions and moral support and
blessings.
Although it is not possible to name individually, I shall ever remain indebted
to the faculty members of Institute of Technology & Management, Pilani for
their persistent support and cooperation extended during this work.

This acknowledgement will remain incomplete if I fail to express our deep


sense of obligation to my parents and God for their consistent blessings and
encouragement.

Vivek Budania
TABLE OF CONTENT

1. Acknowledgement

2. Introduction

3. Organization

4. Basics Of Java
4.1. Overview Of Java
4.2. Features Of Java
4.3. Java Class Path Setting
4.4. Steps For Compiling and Executing Programs
4.5. Difference Between JDK, JRE And JVM
4.6. Object And Class
4.7. Data Types
4.8. Variables
4.9. Operators And Its Types

5. Programming Concepts
5.1. Structure Of Java Program
5.2. Main Method
5.3. Decision Making Statement
5.4. Looping Statement
5.5. Wrapper Classes
5.6. Access Modifiers

6. Java Useful Keywords


6.1. Final
6.2. Static
6.3. This
6.4. Super
6.5. Synchronized

7. Java Classes, Blocks And Constructors


7.1. Abstract Classes
7.2. Constructors
7.3. Constructors And Its Types
7.4. Static Block In Java
7.5. Relationship in java
8. Java Object Oriented
8.1. Inheritance
8.2. Method Overloading
8.3. Method Overriding
8.4. Interface
8.5. Abstraction
8.6. Encapsulation
8.7. Polymorphism
9. Java Advanced
9.1. Package
9.2. Exception Handling
9.3. Thread
9.4. Collections
9.5. Multithreading

10. Conclusion
2. INTRODUCTION

Java is one of the programming language or technology used for developing


web Applications . Java language developed at SUN Micro Systems in the year
1995 under the guidance of James
Gosling and their team. Originally SUN Micro Systems is one of the Academic
University ( Standford University Network)

Whatever the software developed in the year 1990, SUN Micro Systems has
released on the name of oak, which is original name of java (scientifically
oak is one of the tree name). The OAK has taken 18 months to develop . The
oak is unable to fulfill all requirements of the industry. So James Gosling
again reviews this oak and released with the name of java in the year 1995.
Scientifically java is one of the coffee seed name.

Java divided into three categories, they are

2.1 J2SE (Java 2 Standard Edition)

2.2 J2EE (Java 2 Enterprise Edition)


2.3 J2ME (Java 2 Micro or Mobile Edition)

2.1 J2SE

J2SE is used for developing client side applications.

2.2 J2EE

J2EE is used for developing server side applications.

2.3 J2ME

J2ME is used for developing mobile or wireless application by making


use of a predefined protocol called WAP (wireless Access /
Application protocol).
3 ORGANISATION

Codsoft is a reputed organization specializing in software development,


IT solutions, and internship programs tailored to empower students
with hands-on industry experience. The company fosters a learning
environment where interns are encouraged to develop their technical
and professional skills through real-world projects

4 BASICS OF JAVA

4.1 Overview Of Java

Java is a platform independent, more powerful, secure, high


performance, multithreaded programming language. Here we discuss
some points related to java.

Define JRE

The Java Runtime Environment (JRE) is part of the Java Development


Kit (JDK). It contains set of libraries and tools for developing java
application. The Java Runtime Environment provides the minimum
requirements for executing a Java application.

Define JVM

JVM is set of programs developed by sun Micro System and supplied


as a part of jdk for reading line by line of byte code and it converts
into native understanding form of operating system. Java language is
one of the compiled and interpreted programming language.

Garbage Collector

Garbage Collector is the system Java program which runs in the background
along with regular Java program to collect un-Referenced (unused) memory
space for improving the performance of our applications

Define an API
An API (Application Programming Interface) is a collection of
packages, a package is the collection of classes, interfaces and
subpackages. A sub- package is a collection of classes interfaces and
sub sub packages etc.

Java programming is containing user friendly syntax so that we can develop


effective application
s. in other words if any language is providing user friendly syntax, we can
develop error free applications. Definition
of JIT

JIT is the set of programs developed by SUN Micro System and added as a part
of JVM, to speed up the interpretation phase

4.2 Features Of JAVA

Features of a language are nothing but the set of services or facilities


provided by the language vendors to the industry programmers. Some
important features are;
4.3 Java Class path Setting Steps For Compiling and Executing Programs

The following sequence of steps represented in the diagram use compiling the
java program and executing the java programs.

4.5 Difference Between JDK, JRE AND JVM

JVM, JRE, JDK these all the backbone of java language. Each
components have separate works. JDK and JRE physically exists but
JVM are abstract machine it means it not physically exists.

4.5.1 JVM: JVM (Java Virtual Machine) is a software. It is a


specification that provides runtime environment in which java bytecode
can be executed. It not physically exists. JVMs are not same for all
hardware and software, for example for window OS JVM is different
and for Linux VJM is different. JVM, JRE and JDK are platform
dependent because configuration of each OS differs. But Java is
platform independent.

4.5.2 JRE: The Java Runtime Environment (JRE) is part of the Java
Development Kit (JDK). It contains set of libraries and tools for
developing java application. The Java Runtime Environment provides
the minimum requirements for executing a Java application. It
physically exists. It contains set of libraries + other files that JVM uses
at runtime.

4.5.3 JDK: The Java Development Kit (JDK) is primary components.


It physically exists. It is collection of programming tools and JRE,
JVM.
4.6 Object And Class

Object is the physical as well as logical entity whereas class is the only
logical entity. Class: Classis a blue print which is containing only list
of variables and method and no memory is allocated for them. A class
is a group of objects that has common properties.

4.6.1 A class in java contains:

4.6.1.1 Data Member

4.6.1.2 Method

4.6.1.3 Constructor
4.6.1.4 Block

4.6.1.5 Class and Interface


4.6.2 Object: Object is a instance of class, object has state and behaviors. An
Object in java has three characteristics:
4.6.2.1 State

4.6.2.2 Behavior

4.6.2.3 Identity

4.6.3 State: Represents data (value) of an object.


4.6.4 Behavior: Represents the behavior (functionality) of an object such as
deposit, withdraw etc. Identity: Object identity is typically implemented via a
unique ID. The value of the ID is not visible to the external user. But, it is used
internally by the JVM to identify each object uniquely.

Class is also can be used to achieve user defined data types. 4.7
Data Types

Datatype is a special keyword used to allocate sufficient memory space


for the data, in other words Data type is used for representing the data in
main memory (RAM) of the computer.
In general, every programming language is containing three categories of data
types. They are

4.7.1 Fundamental or primitive data types


4.7.2 Derived data types
4.7.3 User defined data types.

Data Type Default Value Default size

boolean false 1 bit

char '\u0000' 2 byte

byte 0 1 byte

short 0 2 byte

int 0 4 byte

long 0L 8 byte

float 0.0f 4 byte

4.8 Variable

Variable is an identifier which holds data or another one variable is an


identifier whose value can be changed at the execution time of
program. Variable is an identifier which can be used toidentify input
data in a program.

4.9 Operators And Its Types

Operator is a special symbol that tells the compiler to perform specific


mathematical or logical Operation. Java supports following lists of
operators.
4.9.1 Arithmetic Operators

4.9.2 Relational Operators

4.9.3 Logical Operators

4.9.4 Bitwise Operators


4.9.5 Assignment Operators
5 PROGRAMMING CONCEPTS

5.1 Structure Of Java Program

Structure of a java program is the standard format released by


Language developer to the industry programmer. Sun Micro System
has prescribed the following structure for the java programmers for
developing java application.
A package is a collection of classes, interfaces and sub-packages. A sub
package contains collection of classes, interfaces and sub-sub packages etc.
java. Lang.*; package is imported by default and this package is known as
default package.
Class is keyword used for developing user defined data type and every java
program must start with a concept of class.

5.2 Main() Method

main() method is starting execution block of a java program or any java


program start their execution from main method. If any class contain
main() method known as main class.

5.3 Decision Making Statement

Decision making statement statements is also called selection


statement. That is depending on the condition block need to be
executed or not which is decided by condition. If the condition is "true"
statement block will be executed, if condition is "false" then statement
block will not be executed. In java there are three types of
decisionmaking statement. 5.3.1 if
5.3.2 if-else
5.3.3 switch
5.4 Looping Statements
Looping in programming languages is a feature which facilitates the execution of
a set of instructions/functions repeatedly while some condition evaluates to true.
Java provides three ways for executing the loops. While all the ways provide
similar basic functionality, they differ in their syntax and condition checking time.
java provides Three types of Conditional statements this second type is loop
statement .

5.4.1 for loop

5.4.2 while loop

5.4.3 do-while loop

5.5 Wrapper Classes

For each and every fundamental data type there exist a pre-defined
class, such predefined class is known as wrapper class. The purpose of
wrapper class is to convert numeric string data into numerical or
fundamental data.

5.6 Access modifiers:

Access modifiers are those which are applied before data members or
methods of a class. These are used to where to access and where not to
access the data members or methods. In java programming we have
four access modifiers they are
6 USEFUL KEYWORDS

6.1 Final keyword

In java language final keyword can be used in following way.

6.1.1 Final at variable level


6.1.2 Final at method level
6.1.3 Final at class level

6.2 Static keyword

The static keyword is used in java mainly for memory management. Static
keyword are used with variables, methods, blocks and nested class. Static is a
keyword that are used for share the same variable or method of a given class. This
is used for a constant variable or a method that is the same for every instance of a
class. The main method of a class is generally labeled static.

In java language static keyword can be used for following

6.2.1 variable (also known as class variable)

6.2.2 method (also known as class method)

6.2.3 block

6.2.4 nested class

6.3 This keyword


this is a reference variable that refers to the current object. It is a keyword in java
language represents current class object

"this" keyword can be use in two ways.

6.3.1 this . (this dot)


6.3.2 this() (this off)
JAVA

6.4 Super keyword


Super keyword in java is a reference variable that is used to refer parent
class object. Super is an implicit keyword create by JVM and supply
each and every java program for performing important role in three
places. 6.4.1 At variable level
6.4.2 At method level
6.4.3 At constructor level

6.5 Synchronized Keyword

Synchronized Keyword is used for when we want to allow only one


thread at a time then use Synchronized modifier. If a method or block
declared as a Synchronized then at a time only one thread is allowed to
operate on the given object.
7 CLASSES, BLOCKS AND CONSTRUCTORS

7.1 Abstract Classes

We know that every java program must start with a concept of class that
is without classes concept there is no java program perfect . In java
programming we have two types of classes they are
7.1.1 Concrete class

7.1.2 Abstract class

7.2 Constructor

A constructor is a special member method which will be called


implicitly (automatically) by the JVM whenever an object is created
for placing user or programmer defined values in place of default
values. In a single word constructor is a special member method which
will be called automatically whenever object is created.

The purpose of constructor is to initialize an object called object


initialization. Constructors are mainly create for initializing the object.
Initialization is a process of assigning user defined values at the time
of allocation of memory space.

7.3 Types of constructors

Based on creating objects in Java constructor are classified in two types. They are

7.3.1 Default or no argument Constructor 7.3.2


Parameterized constructor.

7.4 Static Block in Java

Static block is a set of statements, which will be executed by the JVM


before execution of main method. At the time of class loading if we
want to perform any activity we have to define that activity inside
static block because static block execute at the time of class loading.

In a class we can take any number of static block but all these static block will
be execute from top to bottom.
JAVA

7.5 Relationship in Java

Type of relationship always makes to understand how to reuse the feature


from one class to another class. In java programming we have two types of
relationship they are.

7.5.1 Is-A Relationship


7.5.2 Has-A Relationship
8 OBJECT ORIENTED

8.1 Inheritance

The process of obtaining the data members and methods from one
class to another class is known as inheritance. It is one of the
fundamental features of object-oriented programming.

A class that is declared with abstract keyword, is known as abstract class. An


abstract class is one which is containing some defined method and some undefined
method. In java programming undefined methods are known as un-Implemented
or abstract method . The process of obtaining the data members and methods from
one class to another class is known inheritance. It is one of the fundamental
features of object-oriented programming.

8.1.2 Types of Inheritance

8.1.2.1 Single inheritance

8.1.2.2 Multiple inheritance


8.1.2.3 Hierarchical inheritance

8.1.2.4 Multilevel inheritance

8.1.2.5 Hybrid inheritance


8.2 Method Overloading

Whenever same method name is exiting multiple times in the same


class with different number of parameter or different order of
parameters or different types of parameters is known as method
overloading.

8.2.1 Why method Overloading?

Suppose we have to perform addition of given number but there can


be any number of arguments, if we write method such as a(int, int)for
two arguments, b(int, int, int) for three arguments then itis very
difficult for you and other programmer to understand purpose or
behaviors of method they can not identify purpose of method. So we
JAVA

use method overloading to easily figure out the program. For example
above two methods we can write sum(int, int) and sum(int, int, int)
using method overloading concept.

8.2.2 Different ways to overload the method

There are three ways to overload the method in java

8.2.2.1 By changing number of arguments or parameters

8.2.2.2 By changing the data type

8.2.2.3 By changing the order of arguments.

8.3 Method Overriding

Whenever same method name is existing in both base class and derived
class with same types of parameters or same order of parameters is known
as method Overriding.
8.4 Interface

Interface is similar to class which is collection of public static final


variables (constants) and abstract methods .The interface is a
mechanism to achieve fully abstraction in java. There can be only
abstract methods in the interface. It is used to achieve fully abstraction
and multiple inheritance in Java.

8.4.1 Why we use Interface?

8.4.1.1 It is used to achieve fully abstraction.

8.4.1.2 By using Interface, you can achieve multiple inheritance in java.

When we use abstract and when Interface


If we do not know about any things about implementation just we have
requirement specification then we should be go for Interface

If we are talking about implementation but not completely (partially


implemented) then we should be go for abstract

8.5 Abstraction

Abstraction is the concept of exposing only the required essential


characteristics and behavior with respect to a context.

Hiding of data is known as data abstraction. In object oriented


programming language this is implemented automatically while
writing the code in the form of class and object.
Real life example of Abstraction

Abstraction shows only important things to the user and hides the
internal details for example when we ride a bike, we only know about
how to ride bike but can not know about how it work? and also we do
not know internal functionality of bike.
8.6 Encapsulation

Encapsulation is a process of wrapping of data and methods in a single


unit is called encapsulation. Encapsulation is achieved in java
language by class concept . Combining of state and behavior in a single
container is known as encapsulation. In java language encapsulation
can be achieve using class keyword, state represents declaration of
variables on attributes and behavior represents operations in terms of
method.

8.6.1 Benefits of encapsulation

8.6.1.1 Provides abstraction between an object and its clients.

8.6.1.2 Protects an object from unwanted access by clients.


8.6.1.3 Example: A bank application forbids (restrict) a client to change an
Account's balance

8.7 Polymorphism

The process of representing one form in multiple forms is known as


Polymorphism. Here original form or original method always resides
in base class and multiple forms represents overridden method which
resides in derived classes.

Polymorphism is not a programming concept but it is one of the


principal of OOPs. For many objects oriented programming language
polymorphism principle is common but whose implementations are
varying from one objects oriented programming language to another
object oriented programming language.

8.7.1 Polymorphism principal is divided into two sub principal they are:

8.7.1.1 Static or Compile time polymorphism


8.7.1.2 Dynamic or Runtime polymorphism

9 JAVA ADVANCED

9.1 Package

A package is a collection of similar types of classes, interfaces and


sub- packages. Purpose of package
The purpose of package concept is to provide common classes and
interfaces for any program separately. In other words if we want to
develop any class or interface which is common for most of the java
programs than such common classes and interfaces must be place in a
package.

9.2 Exception Handling

The process of converting system error messages into user friendly


error message is known as Exception handling. This is one of the
powerful feature of Java to handle run time error and maintain normal
flow of java application.

An Exception is an event, which occurs during the execution of a program,


that disrupts the normal flow of the program's Instructions.

9.2.1 Type of Exception


9.2.1.1 Checked Exception
9.2.1.2 Un-Checked Exception

9.3 Thread

Thread is a lightweight component and it is a flow of control. In other words


a flow of control is known as thread.
9.3.1 State of a thread are classified into five types they are

9.3.1.1 New State

9.3.1.2 Ready State

9.3.1.3 Running State

9.3.1.4 Waiting State

9.3.1.5 Halted or dead State


9.4 Collection

Collections in java is a framework that provides an architecture to store


and manipulate the group of objects . All the operations that you perform
on a data such as searching, sorting, insertion, manipulation, deletion
etc. can be performed by Java Collections . Java Collection simply
means a single unit of objects. Java Collection framework provides
many interfaces (Set, List, Queue, Deque etc.) and classes (Array List ,
Vector, LinkedList, Priority Queue, HashSet, Linked HashSet, Tree Set
etc ).

9.5 Multithreading

Multithreading in java is a process of executing multiple threads


simultaneously. The aim of multithreading is to achieve the concurrent
execution.
Modules Provided:

Using Encrypted Password

✓ Add Records

✓ Display Records

✓ Update Records

✓ Delete Records
✓ Search Records

✓ Exit

10 CONCLUSION

Practical knowledge means the visualization of the knowledge, which we


read in our books. For this, we perform experiments and get
observations. Practical knowledge is very important in every field. One
must be familiar with the problems related to that field so that he may
solve them and become a successful person.
After achieving the proper goal in life, an engineer has to enter in
professional life. According to this life, he has to serve an industry, may
be public or private sector or self-own. For the efficient work in the field,
he must be well aware of the practical knowledge as well as theoretical
knowledge.

Due to all above reasons and to bridge the gap between theory and
practical, our Engineering curriculum provides a practical training of 1
month . During this period a student work in the industry and get well
all type of experience and knowledge about the working of companies
and hardware and software tools.

The Codsoft internship was a transformative experience that provided


invaluable insights into software development. By working on diverse
projects, I honed my technical and interpersonal skills, making this
internship a crucial step in my career journey

You might also like