0% found this document useful (0 votes)
17 views49 pages

Ir Bhavesh

Uploaded by

Garvit Dani
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
17 views49 pages

Ir Bhavesh

Uploaded by

Garvit Dani
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd
You are on page 1/ 49

JAVA PROGRAMMING FUNDAMENTALS

An Internship-(II) Report
Submitted in partial fulfillment of the requirement
for the degree of
Bachelor of Technology In
Computer Science and
Engineering July-December 2024

Department of Computer Science and Engineering Mahakal


Institute of Technology, Ujjain
Affiliated to Rajiv Gandhi Proudyogiki Vishwavidyalaya, Bhopal

SUBMITTED BY:

Bhavesh kahar

(0704CS221048)
INTERNSHIP CERTIFICATE

I
RECOMMENDATION

The Internship work entitled “Java Programming Fundamentals” submitted by Bhavesh


Kahar is recommended towards partial fulfillment for the award of the Bachelor of Technology
in Computer Science and Engineering from Mahakal Institute of Technology, Ujjain by
Rajiv Gandhi Proudyogiki Vishwavidyalaya, Bhopal.

Internship Coordinator Head

Prof. Sharad Morolia Department of Computer Science and

Engineer Date: Prof. Balram Yadav

II
DECLARATION

I Bhavesh Kahar hereby declare that I have undertaken 2 weeks internship work at “Infosys
Springboard” during a period from 24/06/2024 to 07/07/2024 in partial fulfillment for the award
of the Bachelor of Technology in Computer Science and Engineering from Mahakal
Institute of Technology, Ujjain by Rajiv Gandhi Prodyogiki Vishwavidyalaya, Bhopal. The
work which is being presented in the internship report submitted to Department of Computer
Science & Engineering from Mahakal Institute of Technology, Ujjain, is an authentic record of
training work.

Date: Bhavesh Kahar

0704CS221048

III
ACKNOWLEDGEMEN

The successful completion of this internship report would not have been possible without the support
and assistance of many individuals and organizations. I feel immensely blessed to have gotten this
during the course of my internship program. I would like to take this opportunity to offer my earnest
admiration to each and every one of them.

I am in debted and thankful to my learned and revered Prof. Balram Yadav, Head of Department of
Computer science and Engineering, Mahakal Institute of Technology, Ujjain(M.P),for his encouraging
support and providing a meticulous platform to learn.

I own my deepest gratitude to internship coordinator Prof. Sharad Morolia for his upbeat personality,
kindness, encouraging support and willingness to help, have tangibly and greatly improve the quality
of my internship report and brought up to its present status.

Thanks to my classmates who helped me directly or in directly to accomplish my work. Finally, I


thank all my teachers, who were the people, who prepared us for this endeavour. I owe you all my
success.

I
ABOUT

Infosys is a global leader in next-generation digital services and consulting. Established in 1981
and headquartered in Bengaluru, India, the company provides a wide range of services including
IT consulting, software development, and business process outsourcing. Infosys helps clients
across industries to transform and adapt to the digital age through innovative solutions involving
artificial intelligence, cloud computing, and blockchain. The company is also dedicated to
corporate responsibility and sustainability through initiatives like Infosys Springboard, an
education and learning platform offering free access to skill-building resources.

V
TABLE OF

Internship Certificate provided by the Company/Industry/Institute I


Recommendation II

Declaration III

Acknowledgement IV

About Company/Industry/Institute V

Table of Contents VI

Abstract VII

Figure Index VIII

CHAPTER 1 : INTRODUCTION
(This chapter should include the background of the topic of the training, theoretical
explanation about the same, SW/HW tools learned)
(1-4)

1.1 Overview of Java 01

1.2 History and Evolution 01

1.3 Feature of Java 02

1.4 JDK, JVM, JRE 03

1.5 Java Edition 04

V
CHAPTER 2 TRAINING WORK UNDERTAKEN (5-22)
(This chapter should include the sequential learning
steps, methodology followed and project undertaken, if
any)

2.1 Module – 1 : Basic Java Syntax (5-7)

1.1 Setting Up Java Development Environment 05

1.2 Java Program Structure 06

1.3 Compilation and Execution of Java Programs 07

2.2 Module – 2 : Data Types and Variables (8-10)

2.1 Data Types 08

2.2 Variables 09

2.3 Module – 3 : Operators And Expressions (11-13)

3.1 Arithmetic Operators 11

3.2 Relational Operators 12

3.3 Logical Operators 12

3.4 Bitwise Operators 13

2.4 Module – 4 : Conditional Structures (14-15)

4.1 Conditional Structure 14

4.2 Loops 15

4.3 Loop Control Statement 15

V
2.5 Module – 5 : Object Oriented Programming (16-22)

5.1 Classes and Objects 16

5.2 Encapsulation 17

5.3 Inheritance 18

5.4 Polymorphism 20

5.5 Abstraction 21-22

CHAPTER 3 RESULTS AND DISCUSSION (23-25)

(This chapter should include any results and the related discussions for
the projects made during training. If no project has been made the results
and snapshots for the tools learnt should be included)

3.1 Exception Handling 20

3.2 File I/O Operation 20

3.3 Multithreading and Thread Synchronization 21

3.4 Project 22

CHAPTER 4 CONCLUSION AND LEARNING


KEY TAKEAWAYS FROM THE
INTERNSHIP
(This chapter should include any results and the related discussions for (26-28)
the projects made during training. If no project has been made the results
and snapshots for the tools learnt should be included)

4.1 Personal Growth and Technical Skill Enhancement 26

4.2 Final Thoughts on Java’s Importance in SDLC 28

REFERENCES 29

V
APPENDIX A (30-31)
Screenshots

APPENDIX B (32-37)
Daily Diary

V
ABSTRAC

This report documents the experiences and learnings during the internship at Infosys
Springboard, with a focus on mastering Java Programming Fundamentals (Core Java). The
training covered key topics such as object-oriented programming, exception handling,
multithreading, and file input/output operations. A practical project, involving the
development of an ATM system, was undertaken to apply theoretical concepts to a real-world
scenario. The project demonstrated skills in Java programming, enhancing problem-solving
abilities and providing a strong foundation for future software development projects.

V
FIGURE

Figure No. Title of Figure Page No.

Figure 1.1 Structure of Java 01

Figure 1.2 Feature of Java 03

Figure 1.3 Java Edition 04

Figure 2.1 Java Execution Process 08

Figure 3.1 Data Types 09

Figure 3.2 Variables 10

Figure 3.3 Conditional Statement 14

Figure 3.4 Structure of Loop 15

Figure 3.5 Object Oriented Programming (OOP’S) 16

Figure 4.1 Types of Inheritance 18

Figure 4.2 Types of Polymorphism 19

Figure 4.3 Implementation Method of Abstraction 20

Figure 4.4 Exceptional Handling 21

Figure 4.5 File I/O Operation 21

Figure 4.5 Thread Synchronization 22

Figure 4.6 Project 23

VI
Java Programming

CHAPTER : 1
INTRODUCTION

1.1OVERVIEW OF JAVA

Java is a high-level, object-oriented programming language that was developed by Sun


Microsystems (now owned by Oracle Corporation) in the mid-1990s. It is designed to have a
few implementation dependencies, allowing developers to write code that can run on
any platform that supports Java without the need for recompilation. This "write once, run
anywhere" capability has made Java one of the most popular programming languages in the
world.

Fig. 1.1 Structure of Java

1.2HISTORY AND EVOLUTION

 1991 : Java was initiated as a project called "Green" at Sun Microsystems, led by James
Gosling. The language was originally intended for consumer electronics.

 1995 : Java 1.0 was officially released. It introduced the core features of Java,
including its syntax and object-oriented principles.

Department of Computer Science and Engineering, Mahakal Institute of Technology, 1


Java Programming

 1996 : The first version of the Java Development Kit (JDK) was released, enabling
developers to create Java applications.

 2006 : Java was released as open-source, which significantly increased its adoption and
community contributions.

 2010 : Oracle acquired Sun Microsystems and took over the development and
management of Java.

 2021 : Java 17 was released as a Long-Term Support (LTS) version, continuing the
language's evolution with new features and improvements.

1.3 Platform
FEATURESIndependence:
OF JAVA Java programs are compiled into bytecode, which can run on
any Java Virtual Machine (JVM), making it platform-independent. This is a key aspect
of Java's philosophy.

 Security: Java provides a robust security model that includes features like bytecode
verification, a security manager, and a set of APIs for secure programming, making it
suitable for networked and web-based applications.

 Portability: Because of its platform independence and the use of bytecode, Java
applications can be easily transferred and executed on different platforms without
modification.

Department of Computer Science and Engineering, Mahakal Institute of Technology, 2


Java Programming

Fig. 1.2 Feature of Java

1.4JDK, JVM, JRE

 JDK (Java Development Kit): A software development kit that provides tools and
libraries for developing Java applications. It includes the Java compiler, tools
for debugging, and other utilities.

 JVM (Java Virtual Machine): An abstract computing machine that enables a computer
to run Java programs. It interprets the compiled Java bytecode and translates it
into machine code for execution.

 JRE (Java Runtime Environment): A part of the JDK that provides the libraries and
components necessary to run Java applications. It includes the JVM, core libraries, and
other resources needed for running Java programs.

1.5 JAVA EDITIONS

Department of Computer Science and Engineering, Mahakal Institute of Technology, 3


Java Programming

 Java SE (Standard Edition): The core Java platform that provides the basic
functionalities for developing desktop applications and applets. It includes essential
libraries and APIs for GUI development, networking, I/O, and more.

 Java EE (Enterprise Edition): A set of specifications that extends Java SE for


developing large-scale, multi-tiered, distributed applications. It includes APIs for web
services, servlets, Enterprise JavaBeans (EJB), and more. Java EE is widely used for
building enterprise-level applications.

 Java ME (Micro Edition): A subset of Java designed for developing applications on


resource-constrained devices such as mobile phones, embedded systems, and IoT
devices. It provides a lightweight framework for building applications in environments
with limited resources.

Fig. 1.3 Java Edition

This overview highlights the fundamentals of Java, its historical context, core features, key
components, and the various editions tailored for different application types.

Department of Computer Science and Engineering, Mahakal Institute of Technology, 4


Java Programming

CHAPTER : 2
MODULE : 1
BASIC JAVA SYNTAX

Basic Java Syntax refers to the set of rules that define the structure of a Java program.
Understanding syntax is crucial for writing valid Java code. Key components include:

 Identifiers: Names given to elements such as variables, classes, and methods. Identifiers
must start with a letter, underscore, or dollar sign, followed by letters, digits, underscores,
or dollar signs. They are case-sensitive (e.g., myVariable and myvariable are different).

 Keywords: Reserved words in Java that have predefined meanings, such


as class, public, static, void, if, else, for, and while. Keywords cannot be used as
identifiers.

 Data Types: Java is statically typed, meaning variables must be declared with a specific
data type, such as int, double, char, boolean, etc.

 Operators: Symbols that perform operations on variables and values. Common operators
include arithmetic (+, -, *, /), relational (==, !=, <, >), and logical (&&, ||, !).

 Control Statements: Used to control the flow of execution. This includes conditional
statements (if, switch) and loops (for, while, do-while)

To
1.1start programming
SETTING UP in Java,
JAVAyou DEVELOPMENT
need to set up a Java ENVIRONMENT
Development Environment. This
typically involves:

 Installing JDK: Download the Java Development Kit (JDK) from the official Oracle
website or OpenJDK distribution. The JDK includes the Java Runtime Environment
(JRE), the Java compiler, and other tools.

Department of Computer Science and Engineering, Mahakal Institute of Technology, 5


Java Programming

 Setting Environment Variables: After installation, configure environment variables


such as JAVA_HOME (points to the JDK installation directory) and update the PATH
variable to include the JDK's bin directory. This allows you to run Java commands from
the command line.

 Choosing an IDE: While you can write Java code in any text editor, using an Integrated
Development Environment (IDE) like Eclipse, IntelliJ IDEA, or NetBeans can enhance
productivity with features like code completion, debugging tools, and project
management.

 Verify Installation: Open a terminal or command prompt and type java -version to check
your Java installation.

1.2JAVA PROGRAM STRUCTURE

A typical Java program follows a specific structure:

 Class Declaration: Every Java program must have at least one class, defined using
the class keyword. The class name should match the filename
(e.g., HelloWorld.java contains public class HelloWorld).

 Main Method: The entry point of any Java application is the main method, defined as
public static void main(String[] args). This method is where the program begins
execution.

 Statements: Inside the main method, you can write statements that define the program's
behavior, such as variable declarations, method calls, and control flow statements.

 Example: java public class HelloWorld { public static void main(String[] args)
{ System.out.println("Hello, World!"); } }

Department of Computer Science and Engineering, Mahakal Institute of Technology, 6


Java Programming

Fig. 1.1 Java Program Structure

Compilation
1.3 and execution areAND
COMPILATION two critical steps in running
EXECUTION OFa Java
JAVAprogram:
PROGRAMS
 Compilation: The Java compiler (javac) translates Java source code (with
a .java extension) into bytecode (with a .class extension) that can be executed by the
JVM. To compile a Java program, use the command:

 javac HelloWorld.java

 Execution: After successful compilation, the bytecode can be executed on the JVM using
the java command: java HelloWorld This will run the main method of
the HelloWorld class, producing output on the console.

By understanding these fundamental aspects of Java, you can effectively write, compile, and run
Java programs while adhering to best practices in coding.

Fig. 1.2 Program Execution Process

Department of Computer Science and Engineering, Mahakal Institute of Technology, 7


Java Programming

MODULE : 2
DATA TYPES AND VARIABLES

2.1DATA TYPES

In Java, data types are essential for defining the nature of data that can be stored and
manipulated within a program. They are categorized into two main groups:

1. Primitive Data Types

2. Reference Data Types

1. PRIMITIVE DATA TYPES

Primitive data types are the most basic types of data built into the Java language. They represent
single values and are not objects. Java has eight primitive data types:

Fig. 2.1 Primitive Data Types

Department of Computer Science and Engineering, Mahakal Institute of Technology, 8


Java Programming

2. REFERENCE DATA TYPES

Reference data types, on the other hand, are used to refer to objects and are created using
classes. These types do not store the actual data. Common examples of reference data types
include:

 Strings: Represent sequences of characters.

String greeting = "Hello, World!";

 Arrays: Used to store multiple values of the same type in a single

variable. int[] numbers = {1, 2, 3, 4, 5};

 Classes: User-defined data types that can contain fields (variables) and methods (functions).

 Interfaces: Abstract types that allow for the definition of methods without
implementing them.

Variables
2.2 are named storage locations in memory that hold data. In Java, variables must be
VARIABLES
declared with a specific data type before they can be used. The syntax for declaring a variable is:

dataType variableName = value;

Fig. 2.2 Variables in Java

Department of Computer Science and Engineering, Mahakal Institute of Technology, 9


Java Programming

In summary, Java's primitive data types and variables provide a robust framework for handling
data. Understanding how to declare variables, use constants, and perform type casting is crucial
for effective programming in Java. With these fundamentals, you can manage data efficiently
and ensure that your code behaves as expected.

Department of Computer Science and Engineering, Mahakal Institute of Technology, 1


Java Programming

MODULE : 3
OPERATORS AND EXPRESSIONS

In Java, operators are special symbols that perform operations on variables and values. They are
fundamental to creating expressions that allow developers to manipulate data and control the
flow of a program. Below is a detailed description of the different types of operators supported
by Java:

Arithmetic
3.1 operators are used OPERATORS
ARITHMETIC to perform basic mathematical operations. The primary arithmetic
operators in Java include:

 Addition (+): Adds two operands.

 Subtraction (-): Subtracts the second operand from the first.

 Multiplication (*): Multiplies two operands.

 Division (/): Divides the first operand by the second. If both operands are integers, the
result is also an integer (the fractional part is discarded).

 Modulus (%): Returns the remainder of the division of the first operand by the second.

Example:

int a = 10, b = 3;

int sum = a + b; // sum = 13

int difference = a - b; // difference =

7 int product = a * b; // product = 30

int quotient = a / b; // quotient = 3

int remainder = a % b; // remainder = 1

Department of Computer Science and Engineering, Mahakal Institute of Technology, 1


Java Programming

3.2 RELATIONAL OPERATORS


Relational operators are used to compare two values. They return a boolean result (true or false).
The relational operators in Java include:

 Greater than (>): Checks if the left operand is greater than the right.

 Less than (<): Checks if the left operand is less than the right.

 Greater than or equal to (>=): Checks if the left operand is greater than or equal to the right.

 Less than or equal to (<=): Checks if the left operand is less than or equal to the right.

 Equal to (==): Checks if two operands are equal.

 Not equal to (!=): Checks if two operands are not equal.

Example:

int x = 5, y = 10;

boolean isGreater = x > y; // isGreater =

false boolean isEqual = x == y; // isEqual =

false

Logical
3.3 operators
LOGICALare used to combine multiple boolean expressions. The primary logical
OPERATORS
operators in Java include:

 Logical AND (&&): Returns true if both operands are true.

 Logical OR (||): Returns true if at least one of the operands is true.

 Logical NOT (!): Reverses the logical state of its operand. If the condition is true, it
becomes false, and vice versa.

Example:

Department of Computer Science and Engineering, Mahakal Institute of Technology, 1


Java Programming

boolean condition1 = true;

boolean condition2 = false;

boolean result = condition1 && condition2; // result = false

Bitwise
3.4 operators
BITWISEperform operations on the individual bits of integer types. They include:
OPERATORS
 Bitwise AND (&): Compares each bit of two numbers and returns a new number with
bits set to 1 where both corresponding bits were 1.

 Bitwise OR (|): Compares each bit of two numbers and returns a new number with bits
set to 1 where at least one of the corresponding bits was 1.

 Bitwise XOR (^): Compares each bit of two numbers and returns a new number with
bits set to 1 where the corresponding bits differ.

 Bitwise NOT (~): Inverts all the bits of the operand.

Example:

int a = 5; // (binary: 0101)

int b = 3; // (binary: 0011)

int andResult = a & b; // andResult = 1 (binary:

0001) int orResult = a | b; // orResult = 7 (binary:

0111)

Operators are integral to programming in Java, enabling developers to perform calculations,


make comparisons, and execute logical operations. Understanding how to effectively use these
operators and expressions is crucial for developing robust Java applications.

Department of Computer Science and Engineering, Mahakal Institute of Technology, 1


Java Programming

MODULE : 4
CONTROL STRUCTURES

Control structures are essential components in programming that manage the flow of execution
within a program. They allow developers to dictate how the program behaves under different
conditions and enable repetitive tasks. Here’s a brief overview of the primary types of control
structures in Java:

Conditional
4.1 structures are used STRUCTURES
CONDITIONAL to make decisions in the program based on certain conditions.
The main types include:

 if Statement: Executes a block of code if a specified condition is true.

 else Statement: Provides an alternative block of code that executes if the condition in the
if statement is false.

 switch Statement: Allows the execution of one block of code among many based on
the value of a variable or expression.

Fig. 4.1 Conditional Statement

Department of Computer Science and Engineering, Mahakal Institute of Technology, 1


Java Programming

4.2 LOOPS
Loops are control structures that allow for the repeated execution of a block of code as long as a
specified condition is true. The primary types of loops in Java include:

 for Loop: Executes a block of code a specific number of times, based on initialization,
condition, and increment/decrement expressions.

 while Loop: Repeatedly executes a block of code as long as a specified condition is true.

 do-while Loop: Similar to the while loop, but guarantees that the block of code will
execute at least once, as the condition is checked after the code execution.

Fig. 4.2 Structure of Loop

4.3LOOP CONTROL STATEMENTS

Loop control statements manage the behavior of loops and can alter the normal flow of
execution within them:

 break: Exits the loop immediately, regardless of the loop condition.

 continue: Skips the current iteration of the loop and proceeds to the next iteration.

Department of Computer Science and Engineering, Mahakal Institute of Technology, 1


Java Programming

MODULE : 5
OBJECT-ORIENTED PROGRAMMING (OOP)

Object-Oriented Programming (OOP) is a programming paradigm that is fundamental to the Java


programming language. It focuses on the concept of objects, which are instances of classes.
These classes serve as blueprints for creating objects, encapsulating both data
(known as fields or attributes) and behavior (defined by methods). The principles of OOP are
crucial for developing robust, maintainable, and reusable code. Below is a detailed exploration of
the core principles of OOP as they relate to Java.

Fig. 5.1 Object Oriented Programming (OOP)

A5.1
class inCLASSES
Java is a template
AND that defines the structure and behavior of objects. It contains
OBJECTS
fields that represent the state of an object and methods that define the actions or behaviors that
the object can perform. When a class is instantiated, it creates an object that embodies the
properties defined by the class.

Example:

class Car {

String color; // Field

Department of Computer Science and Engineering, Mahakal Institute of Technology, 1


Java Programming

int year; // Field

void drive() { //

Method

System.out.println("The car is driving.");

// Creating an object of the Car

class Car myCar = new Car();

myCar.color = "Red";

myCar.year = 2020;

myCar.drive(); // Output: The car is driving.

Encapsulation
5.2 is a fundamental principle of OOP that restricts direct access to some of an
ENCAPSULATION
object's components, which is a means of preventing unintended interference and misuse of the
methods and data. By using access modifiers (such as private, protected, and public), developers
can control the visibility of class members. This promotes data hiding and ensures that the
internal representation of an object is shielded from outside interference.

Example:

class BankAccount {

private double balance; // Field is private

Department of Computer Science and Engineering, Mahakal Institute of Technology, 1


Java Programming

public void deposit(double amount) { // Public method to modify

balance if (amount > 0) {

balance += amount;

public double getBalance() { // Public method to access

balance return balance;

5.3INHERITENCE

Inheritance is a mechanism in OOP that allows one class (the subclass or child class) to inherit
the fields and methods of another class (the superclass or parent class). This promotes code
reusability and establishes a hierarchical relationship between classes. A subclass can also
override methods of the superclass to provide specific implementations.

Example:

class Vehicle {

// Superclass

void start()

System.out.println("Vehicle is starting.");

}
Department of Computer Science and Engineering, Mahakal Institute of Technology, 1
Java Programming

class Bike extends Vehicle {

// Subclass

void start()

System.out.println("Bike is starting.");

// Creating an object of the

subclass Bike myBike = new

Bike(); myBike.start();

// Output: Bike is starting.

Fig. 5.2 Types of Inheritance

Department of Computer Science and Engineering, Mahakal Institute of Technology, 1


Java Programming

5.4 POLYMORPHISM
Polymorphism allows methods to perform different actions based on the object that it is acting
upon. In Java, polymorphism is typically achieved through method overriding and method
overloading. This enables a single interface to represent different underlying forms (data types).

 Method Overriding: When a subclass provides a specific implementation of a method that


is already defined in its superclass.

 Method Overloading: When multiple methods have the same name but differ in
parameters (type or number).

Fig. 5.3 Types of Polymorphism

Example of Method Overriding:

class Animal {

void sound() {

System.out.println("Animal makes a sound.");

class Dog extends Animal {

Department of Computer Science and Engineering, Mahakal Institute of Technology, 2


Java Programming

void sound() {

System.out.println("Dog barks.");

Example of Method Overloading:

class MathOperations {

int add(int a, int b) {

return a + b;

double add(double a, double b)

{ return a + b;

Abstraction
5.5 is the principle of hiding the complex implementation details of a system and
ABSTRACTION
exposing only the essential features to the user. In Java, abstraction can be achieved through
abstract classes and interfaces. An abstract class can have both abstract methods (without a body)
and concrete methods (with a body), while an interface only contains abstract methods.

Example of Abstraction:

abstract class Shape {

abstract void draw(); // Abstract method

Department of Computer Science and Engineering, Mahakal Institute of Technology, 2


Java Programming

class Circle extends Shape

{ void draw() {

System.out.println("Drawing a circle.");

The principles of Object-Oriented Programming—encapsulation, inheritance, polymorphism, and


abstraction—are central to the Java programming language. They enable developers to create
modular, reusable code that is easier to maintain and extend. Through this internship experience,
I have gained a deeper understanding of OOP concepts, which has significantly enhanced my
ability to design and implement Java applications effectively. This knowledge will serve as a
strong foundation for my future work in software development.

Fig. 5.4 Implementation Method of Abstraction

Department of Computer Science and Engineering, Mahakal Institute of Technology, 2


Java Programming

CHAPTER : 3
RESULTS AND DISCUSSION

Throughout my internship at Infosys Springboard, I focused on gaining practical experience in


Core Java concepts. While no full project was developed, I engaged with key Java tools and
features, implementing small code snippets to deepen my understanding.

I3.1
exploredEXCEPTION
how to gracefullyHANDLING
handle errors in Java using try, catch, and finally. By writing code
that intentionally threw exceptions (e.g., dividing by zero or accessing invalid array indices), I
practiced catching exceptions like ArithmeticException and ArrayIndexOutOfBoundsException.
This helped me understand how to maintain program stability, even when unexpected errors
occur.

Code Snapshot:

Fig. 3.1 Exceptional Handling

3.2 I learned
FILE how
I/O toOPERATIONS
perform file operations like reading from and writing to files using
Java’s I/O classes such as FileReader, BufferedReader, FileWriter, and BufferedWriter.
Through

Department of Computer Science and Engineering, Mahakal Institute of Technology, 2


Java Programming

various exercises, I practiced reading data from text files and writing processed output
back to files, understanding how Java handles file streams and exceptions during file
operations (e.g., IOException).

Code Snapshot:

Fig 3.2 File I/O Operations

3.3 I gained hands-on experience with


MULTITHREADING AND Java's multithreading
THREAD capabilities by learning to create
SYNCHRONIZATION
and manage threads using the Thread class and the Runnable interface. I explored how to
run multiple threads concurrently, improve program performance, and manage thread
synchronization.
 Thread synchronization was particularly challenging and enlightening. I learned how to
prevent race conditions and ensure thread-safe operations by using synchronized methods
and blocks. Additionally, I worked with inter-thread communication using wait() and
notify() to coordinate actions between threads in a producer-consumer scenario.

Fig. 3.3 Thread Synchronization

Department of Computer Science and Engineering, Mahakal Institute of Technology, 2


Java Programming

3.4 PROJECT
We implemented an ATM system project using Java, covering key concepts like object-oriented
programming and exception handling. Here's a summary of what your project achieves:

 BankAccount Class: Manages account balance, deposits, and withdrawals with


validations, including minimum and maximum limits.

 ATM Class: Simulates ATM interactions, verifying PIN, handling deposits,


withdrawals, and balance inquiries.

 ATMInterface Class: The main class where user interaction takes place, looping through
ATM menu options until the user exits.

This project demonstrates a solid understanding of basic Java concepts! Let me know if you'd
like further details or improvements.

Fig. 3.4 ATM Interface

This internship provided me with a strong grasp of Java fundamentals. Each concept, from
exception handling to multithreading, was essential in laying the groundwork for future
development projects.

Department of Computer Science and Engineering, Mahakal Institute of Technology, 2


Java Programming

CHAPTER : 4
CONCLUSION AND LEARNINGS
KEY TAKEAWAYS FROM THE INTERNSHIP

During my internship at Infosys, focused on Java Programming Fundamentals, I gained valuable


insights and practical experience that have significantly contributed to my understanding of
software development. Here are the key takeaways:

1. Understanding Core Concepts: I deepened my knowledge of Java fundamentals,


including object-oriented programming principles, data structures, exception handling,
and file I/O operations. This foundational knowledge is crucial for building robust
applications.

2. Hands-On Experience: Working on real-world projects allowed me to apply theoretical


concepts in practical scenarios. I learned how to write clean, efficient, and maintainable
code while adhering to industry standards.

3. Collaboration and Teamwork: I had the opportunity to work closely with experienced
developers and collaborate on team projects. This experience taught me the importance of
effective communication, collaboration, and leveraging each team member's strengths to
achieve common goals.

4. Problem-Solving Skills: Tackling various coding challenges and debugging issues


enhanced my problem-solving skills. I learned how to approach problems methodically,
analyze requirements, and implement solutions effectively.

5. Exposure to Tools and Technologies: I gained hands-on experience with development


tools such as IDEs (Eclipse, IntelliJ IDEA), version control systems (Git), and build tools
(Maven). Familiarity with these tools is essential for modern software development.

This internshipGROWTH
PERSONAL has been a AND
transformative experience
TECHNICAL for my
SKILL personal and technical growth:
ENHANCEMENT

Department of Computer Science and Engineering, Mahakal Institute of Technology, 2


Java Programming

 Confidence in Coding: Regularly writing code and receiving feedback from mentors
boosted my confidence in my programming abilities. I became more comfortable tackling
complex problems and implementing solutions in Java.

 Adaptability: The fast-paced environment at Infosys taught me to adapt quickly to new


technologies and methodologies. I learned to embrace challenges and continuously seek
opportunities for improvement.

 Time Management: Balancing multiple tasks and deadlines helped me develop effective
time management skills. I learned to prioritize tasks and work efficiently under pressure.

 Networking and Professional Development: Interacting with professionals in the field


provided valuable networking opportunities. I gained insights into career paths and
industry trends, which will guide my future endeavors.

Java continues
FINAL to be a cornerstone
THOUGHTS ON JAVA'S of software development
IMPORTANCE for several reasons:
IN SOFTWARE DEVELOPMENT

1. Platform Independence: The "write once, run anywhere" (WORA) capability of Java
allows developers to create cross-platform applications, making it a popular choice for
enterprise-level solutions.

2. Robustness and Security: Java's strong memory management, exception handling, and
security features contribute to building reliable and secure applications, making it suitable
for critical systems.

3. Rich Ecosystem: With a vast array of libraries, frameworks, and tools, Java provides
developers with the resources needed to build scalable and efficient applications.
Frameworks like Spring and Hibernate enhance productivity and simplify development.

4. Community Support: Java boasts a large and active community, which means extensive
documentation, tutorials, and forums are available for learners and professionals alike.
This support fosters continuous learning and knowledge sharing.

Department of Computer Science and Engineering, Mahakal Institute of Technology, 2


Java Programming

In conclusion, my internship at Infosys has been instrumental in shaping my understanding of


Java programming fundamentals and its significance in software development. The skills and
knowledge I acquired will serve as a strong foundation for my future career in technology. I look
forward to applying what I've learned as I continue to grow as a software developer.

Department of Computer Science and Engineering, Mahakal Institute of Technology, 2


Java Programming

REFRENCES

This report is based on the learning experience during the Java Programming Fundamentals
(Core Java) course provided by the Infosys Springboard platform. The course covered essential
topics such as object-oriented programming, exception handling, multithreading, and file
input/output operations. The foundational understanding of these Java concepts was developed
through practical exercises, coding examples, and interactive lessons. The project involved
building an ATM system using Java, incorporating real-world use cases and applications of core
Java principles.

All references and learning materials were accessed through the Infosys Springboard platform,
which offers structured, self-paced learning modules, tutorials, and practice exercises for
programming languages and other skills. This platform played a critical role in enhancing both
theoretical and practical knowledge of Java development.

Department of Computer Science and Engineering, Mahakal Institute of Technology, 2


Java Programming

APPENDIX A
SCREENSHOT

Department of Computer Science and Engineering, Mahakal Institute of Technology, 3


Java Programming

Department of Computer Science and Engineering, Mahakal Institute of Technology, 3


Java Programming

APPENDIX B
DAILY DIARY

DAILY DIARY

Name of the Trainee Bhavesh Kahar College: Mahakal Institute of


Technology Industry Work Place Infosys Springboard Day No.: 1 Week No. 1
Department / Section: Computer Science Date: 24/06/2024

 Attended the orientation session at Infosys Springboard.


DAY 1: ORIENTATION AND INTRODUCTION TO JAVA
 Learned about the internship structure and the role of Java in software development.

 Explored the history and evolution of Java, focusing on its key features like platform
independence and security.

DAILY DIARY

Name of the Trainee Bhavesh Kahar College: Mahakal Institute of


Technology Industry Work Place Infosys Springboard Day No.: 2 Week
No. 1
Department / Section: Computer Science Date: 25/06/2024

 Set up the Java development environment on my laptop.


DAY 2: SETTING UP DEVELOPMENT ENVIRONMENT
 Installed JDK and configured the PATH variable.

 Wrote and executed my first Java program: "Hello, World!"

 Familiarized myself with the structure of a Java program, including the main method.

Department of Computer Science and Engineering, Mahakal Institute of Technology, 3


Java Programming

DAILY DIARY

Name of the Trainee Bhavesh Kahar College: Mahakal Institute of


Technology Industry Work Place Infosys Springboard Day No.: 3 Week No. 1
Department / Section: Computer Science Date: 26/06/2024

DAY
Studied3: BASIC
Java syntax, JAVA
focusingSYNTAX
on comments, data types, and variables.

 Practiced writing programs with proper indentation and documentation.

 Compiled and executed multiple Java programs to solidify my understanding of the


compilation process.

DAILY DIARY

Name of the Trainee Bhavesh Kahar College: Mahakal Institute of


Technology Industry Work Place Infosys Springboard Day No.: 4 Week No. 1
Department / Section: Computer Science Date: 27/06/2024

DAY 4: DATA TYPES AND VARIABLES

Explored primitive (int, float, char, boolean) and non-primitive data types (arrays, strings).

 Worked on exercises to declare, initialize, and manipulate variables.

 Practiced type casting and conversion with various examples

Department of Computer Science and Engineering, Mahakal Institute of Technology, 3


Java Programming

DAILY DIARY

Name of the Trainee Bhavesh Kahar College: Mahakal Institute of


Technology Industry Work Place Infosys Springboard Day No.: 5 Week No. 1
Department / Section: Computer Science Date: 28/06/2024

.
DAY 5: OPERATORS AND EXPRESSIONS
 Learned about different types of operators: arithmetic, relational, logical, and bitwise.

 Completed exercises on operator precedence and associativity.

 Created programs that utilized expressions to solve mathematical problems.

DAILY DIARY

Name of the Trainee Bhavesh Kahar College: Mahakal Institute of


Technology Industry Work Place Infosys Springboard Day No.: 6 Week No. 1
Department / Section: Computer Science Date: 29/06/2024

 Studied decision-making constructs: if, if-else, and switch statements.


DAY 6: CONTROL STRUCTURES
 Practiced writing programs using loops: for, while, and do-while.

 Implemented break and continue statements in loop scenarios.

Department of Computer Science and Engineering, Mahakal Institute of Technology, 3


Java Programming

DAILY DIARY

Name of the Trainee Bhavesh Kahar College: Mahakal Institute of


Technology Industry Work Place Infosys Springboard Day No.: 1 Week No. 2
Department / Section: Computer Science Date: 01/07/2024

DAY 1: OBJECT-ORIENTED PROGRAMMING (OOP) PRINCIPLES

 Attended a workshop on OOP concepts: classes, objects, inheritance, encapsulation,


and polymorphism.

 Created multiple classes and demonstrated method overloading and overriding.

 Worked on exercises to apply OOP principles in practical scenarios.

DAILY DIARY

Name of the Trainee Bhavesh Kahar College: Mahakal Institute of


Technology Industry Work Place Infosys Springboard Day No.: 2 Week No. 2
Department / Section: Computer Science Date: 02/06/2024

DAY 2: ARRAYS
 Studied AND and
one-dimensional STRINGS
multi-dimensional arrays.

 Completed exercises on array manipulation, including searching and sorting algorithms.

 Explored the String class and practiced various string methods (substring, indexOf, etc.).

Department of Computer Science and Engineering, Mahakal Institute of Technology, 3


Java Programming

DAILY DIARY

Name of the Trainee Bhavesh Kahar College: Mahakal Institute of


Technology Industry Work Place Infosys Springboard Day No.: 3 Week No. 2
Department / Section: Computer Science Date: 03/07/2024

 Introduced to exception handling in Java.


DAY 3: EXCEPTION HANDLING
 Practiced writing try, catch, and finally blocks to handle exceptions.

 Explored the throw and throws keywords and learned about checked and unchecked
exceptions.

DAILY DIARY

Name of the Trainee Bhavesh Kahar College: Mahakal Institute of


Technology Industry Work Place Infosys Springboard Day No.: 4 Week No. 2
Department / Section: Computer Science Date: 04/07/2024

 Learned about Java's InputStream and OutputStream classes.


DAY 4: FILE INPUT/OUTPUT (I/O)
 Practiced file handling using the File class.

 Wrote programs to read from and write to text files using BufferedReader and
Buffered Writer.

Department of Computer Science and Engineering, Mahakal Institute of Technology, 3


Java Programming

DAILY DIARY

Name of the Trainee Bhavesh Kahar College: Mahakal Institute of


Technology Industry Work Place Infosys Springboard Day No.: 5 Week No. 2
Department / Section: Computer Science Date: 06/07/2024

DAY 5: COLLECTIONS FRAMEWORK

 Introduced to Java Collections Framework, including List, Set, and Map interfaces.

 Practiced using Array, List, HashSet, and HashMap in various coding exercises.

 Explored iterators and the enhanced for loop for traversing collections.

Department of Computer Science and Engineering, Mahakal Institute of Technology, 3

You might also like