[go: up one dir, main page]

0% found this document useful (0 votes)
24 views26 pages

Ede Internship Report PDF Form

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

Ede Internship Report PDF Form

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

VIRTUAL INTERNSHIP

in
CORE JAVA-EXPERT

Submitted in partial fulfilment of requirements to


IV/IV B.TECH CSBS (VII Semester)
by
GONUGUNTLA YAMINI (Y20CB022)

December 2023
R. V. R. & J. C. COLLEGE OF ENGINEERING (Autonomous)
(NAAC A+ Grade) (Approved by AICTE)
(Affiliated to Acharya Nagarjuna University)
Chandramoulipuram::Chowdavaram,
Guntur - 522019, Andhra Pradesh, India.
R. V. R. & J. C. COLLEGE OF ENGINEERING
DEPARTMENT OF COMPUTER SCIENCE & BUSINESS SYSTEMS

BONAFIDE CERTIFICATE

This is to Certify that, this Internship Report entitled “Virtual Internship in Core Java-
Expert” is the bonafide work of Gonuguntla Yamini (Y20CB022) submitted in partial
fulfilment of requirements to CB451 Internship/Certification for the award of the Degree of
Bachelor of Technology in Computer Science & Business Systems to R. V. R. & J. C. College
of Engineering, during the year 2023 - 2024.

Mr. P. Srinivasa Rao External Examiner Dr. M. V. P. Chandra Sekhara Rao


Assistant Professor HOD, Dept. of CSBS, CSE(DS)
(Lecturer Incharge) (Co-ordinator)
ACKNOWLEDGEMENT

I would like to express my sincere gratitude to the following individuals, who have played a
crucial role in the successful completion of my internship on "Virtual Internship in Core
Java-Expert."

I am thankful to Dr. Kolla Srinivas, Principal of R.V.R &J.C College of Engineering, Guntur
for providing a supportive environment.

I express my thanks to Dr. M. V. P. Chandra Sekhara Rao, Head of the Department of


Computer Science & Business Systems and Computer Science and Engineering(Data Science)
for his motivation to complete this internship.

Furthermore, I would like to thank Hebeon Technologies for providing the opportunity.
Finally, I thank my project mates for cooperating in doing tasks perfectly during the internship.

-Gonuguntla Yamini (Y20CB022)


INTERNSHIP CERTIFICATE
TABLE OF CONTENTS

S. NO. CONTENT PAGE NO.


Abstract
1 Introduction 1
1.1 Java
1.2 Java Environment
2 Basic Concepts of Java 5
2.1 Keywords
2.2 Data Types in Java
2.3 Variables
2.4 Operators
2.5 Flow Control in Java

3 Object Oriented Programming in Java 8


4 Methods and Constructors 11
4.1 Methods
4.2 Constructors
4.3 Method Overloading
5 Packages in Java 13
6 Project 14
7 Conclusion 19
LIST OF FIGURES

S. NO. FIGURE PAGE NO.


1 Java Runtime Environment 2
2 Java Development Kit 2
3 Java Runtime System 3
4 Keywords in Java 5
5 Types of Inheritance 8
ABSTRACT

This report presents the internship conducted by future skills prime on EXPERT JAVA. The
main motivation of this course is students are able to develop logic building problems and
software developments by using Java programming concepts.

Most of the software needs to develop an application which runs cross platform. Java is one of
the pioneer software tools used for cross platform development software. Java is the most
dominant software to develop web applications and distributed applications. This report
provides basic concepts about object oriented programming, java packages, exceptions.

In this Java report, I had the opportunity to gain hands-on experience in developing and
implementing java applications. Throughout the report I worked on various projects, including
creating user-friendly interfaces implementing data structures and optimizing code
performance.

After successful completion of this course learners are able to develop software modules for
real world problems.
1. INTRODUCTION
1.1 Java
The following are some of the features of Java:

Simple: Java is a simple programming language and easy to understand because it does not
contain complexities that exist in prior programming languages.

Object-Oriented: Java is an Object Oriented Programming Language, which means in Java


everything is written in terms of classes and objects.

Platform Independent: Java allows programmers to write their program on any machine with
any configuration and to execute it on any other machine having different configurations.

Portable: The WORA (Write Once Run Anywhere) concept and platform-independent feature
make Java portable, which makes Java codes able to run on a wide variety hardware platforms
having the same interface.

Robust: The Java Programming language is robust, which means it is capable of handling
unexpected termination of a program. There are 2 reasons behind this, first, it has a most
important and helpful feature called Exception Handling. Another reason why Java is strong
lies in its memory management features.

Secure: Security is a fundamental aspect of Java. The language includes features like the
JVM’s security manager, which enforces security policies, and it provides protections against
various security vulnerabilities.

Interpreted: Java programming language uses both a compiler and an interpreter. Java
programs are compiled to generate bytecode files then JVM interprets the byte- code file during
execution. Along with this JVM also uses a JIT compiler.

Multi-Threaded: Java has built-in support for multi-threading, allowing programs to execute
multiple threads concurrently. This is essential for building responsive and efficient
applications.

1.2 Java Environment


JRE: JRE is an acronym for Java Runtime Environment, also written as Java RTE. The JRE
is a set of software tools which are used for developing java applications. It is used to provide

1
a runtime environment. It is the implementation of JVM. It physically exists. It contains a set
of libraries + other files that JVM uses at runtime.

Fig 1: Java Runtime Environment

JDK: The Java Development Kit (JDK) is a software development environment which is
used to develop java applications and applets. It physically exists. It contains JRE +
development tools. JDK is an implementation of any one of the below given Java
Platforms released by Oracle corporation:

• Standard Edition Java Platform

• Enterprise Edition Java Platform

• Micro Edition Java Platform

The JDK contains a private Java Virtual Machine (JVM) and a few other resources such
as an interpreter/loader (Java), a compiler (javac), an archiver (jar), a documentation
generator (Javadoc) etc. to complete the development of a Java Application.

Fig 2: Java Development Kit

2
JVM (Java Virtual Machine): JVM is an abstract machine. It is a specification that provides
a runtime environment in which java byte code can be executed. JVMs are available for many
hardware and software platforms (i.e. JVM is platform dependent). The JVM performs
following operation:

•Loads code

•Verifies code

•Executes code

•Provides runtime environment JVM provides definitions for the:

•Memory area

•Class file format

•Register set

•Garbage-collected heap

Fig 3: Java Runtime System

3
1. Classloader: Classloader is a subsystem of JVM that is used to load class files.

2. Class(Method) Area: Class(Method) Area stores per-class structures such as the runtime
constant pool, field and method data, the code for methods.

3. Heap: It is the runtime data area in which objects are allocated.

4. Stack: Java Stack stores frames. It holds local variables and partial results, and plays a part
in method invocation and return. Each thread has a private JVM stack, created at the same time
as the thread. A new frame is created each time a method is invoked. A frame is destroyed
when its method invocation completes.

5. Program Counter Register: PC (program counter) register contains the address of the

Java virtual machine instruction currently being executed.

4
2. BASIC CONCEPTS OF JAVA

2.1 Keywords
Keywords are words that have already been defined for the Java compiler. They have special
meaning for the compiler. Java Keywords must be in your information because it cannot be
used as a variable, class or a method name.

Fig 4: Keywords in Java

2.2 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 Integer, Character, Boolean, and
Floating Point.
2. Non-primitive data types: The non-primitive data types include Classes, Interfaces, and
Arrays.

2.3 Variables
A variable is a container which holds the value and that can be changed during the execution
of the program. A variable is assigned with a datatype. Variable is a name of memory location.
All the variables must be declared before they can be used. There are three types of variables
in java: local variable, instance variable and static variable.

5
2.4 Operators
Operators in Java are the symbols used for performing specific operations in Java. There are
multiple types of operators in Java as mentioned below:

1. Arithmetic operators: They are used to perform simple arithmetic operations on


primitive data types. They are +, -, *, /, %
2. Assignment operators: They are used to assign data to a variable. They are =, +=, -=,
*=,/=,%=
3. Relational Operators: These operators are used to check for relations like equality,
greater than, and less than. They return boolean results after the comparison. They are
==, !=, >=, <=, >, <
4. Bitwise operators: These operators are used to perform the manipulation of individual
bits of a number. They can be used with any of the integer types. They are &,|,˜,
ˆ,>>,<<
5. Logical operators: These operators are used to perform “logical AND” and “logical
OR” operations, i.e., a function similar to AND gate and OR gate in digital electronics.
They are &&,||, !
6. Unary Operators: Unary operators need only one operand. They are used to
increment, decrement, or negate a value. They are -,+,- -,+ +,!
7. Ternary operator: The ternary operator is a shorthand version of the if-else statement.
It has three operands and hence the name Ternary. The general format is: condition ? if
true : if false

2.5 Flow Control in Java


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.

● Decision Making statements: As the name suggests, decision-making statements


decide which statement to execute and when. Decision-making statements evaluate the
Boolean expression and control the program flow depending upon the result of the
condition provided. There are two types of decision-making statements in Java, i.e., If
statement and switch statement.

6
if
Switch
● Loop Statements: In programming, sometimes we need to execute the block of code
repeatedly while some condition evaluates to true. However, loop statements are used
to execute the set of instructions in a repeated order. The execution of the set of
instructions depends upon a particular condition.
For loop
Do while
While

● Jump Statements: Jump statements are used to transfer the control of the program to
the specific statements. In other words, jump statements transfer the execution control
to the other part of the program. There are two types of jump statements in Java, i.e.,
break and continue.
Break
Continue

7
3. OBJECT ORIENTED PROGRAMMING IN JAVA

Object-Oriented Programming (OOP) is a programming paradigm that focuses on using objects


to design applications and computer programs. In OOP, objects are instances of classes, which
are essentially blueprints that define the data and behaviour of real-world objects. In Java
everything is an object and it is an object oriented programming language.
● Class: A class is a user defined data type or non-primitive data type in Java. A class is
a blueprint that defines the attributes and methods of its objects. With the help of class
features in Java we can create an object with our own properties and built in functions.
● Objects: In Java, everything is an object. Objects have the following properties:
Identity, type and value. An object in Java is created by calling a constructor of its class.
Objects can have attributes (data) and methods (functions) that can operate on that data.
● Inheritance: is a mechanism that allows you to create a hierarchy of classes that share
a set of properties and methods by deriving a class from another class. Inheritance is
the capability of one class to derive or inherit the properties from another class. In this
from which the properties are taken are called as a parent class and the taken class is
called as children class.

Fig 5: Types of Inheritance

● Encapsulation: is one of the most fundamental concepts in object-oriented


programming (OOP). This is the concept of wrapping data and methods that work with
data in one unit. This prevents data modification accidentally by limiting access to

8
variables and methods. An object’s method can change a variable’s value to prevent
accidental changes. These variables are called private variables. Class is the best
example of encapsulation as it wraps all the variables and function under a single class.
● Polymorphism: in Java is a concept by which we can perform a single action in
different ways. Polymorphism is derived from 2 Greek words: poly and morphs. The
word ”poly” means many and ”morphs” means forms. So polymorphism means many
forms. There are two types of polymorphism in Java: compile-time polymorphism and
runtime polymorphism. We can perform polymorphism in java by method overloading
and method overriding.
● Data Abstraction: is the process of hiding certain details and showing only essential
information to the user. Abstraction can be achieved with either abstract classes or
interfaces. The abstract keyword is a non-access modifier, used for classes and
methods: Abstract class: It is a restricted class that cannot be used to create objects (to
access it, it must be inherited from another class. Abstract method: It can only be used
in an abstract class, and it does not have a body. The body is provided by the subclass
(inherited from).
● Interface in Java: Another way to achieve abstraction in Java, is with interfaces. An
interface in Java is a blueprint of a class. It has 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 method body. It is used to achieve abstraction and
multiple inheritance in Java.
● Exception Handling: One of the powerful mechanisms to handle the runtime errors so
that the normal flow of the application can be maintained. In Java, an exception is an
event that disrupts the normal flow of the program. It is an object which is thrown at
runtime. Exception Handling is a mechanism to handle runtime errors such as
ClassNotFoundException, IOException, SQLException, RemoteException, etc. The
core advantage of exception handling is to maintain the normal flow of the application.
An exception normally disrupts the normal flow of the application; that is why we need
to handle exceptions. Java try-catch block used to enclose the code that might throw an
exception. It must be used within the method. If an exception occurs at the particular
statement in the try block, the rest of the block code will not execute. So, it is
recommended not to keep the code in try block that will not throw an exception. Java
try block must be followed by either catch or finally block.

9
Syntax

try{

//code that may throw an exception

catch(Exception class Name ref){ }

10
4. METHODS AND CONSTRUCTORS
4.1 Methods
Set of instructions to perform a particular or specific task is called a method. Is a set of
statements that is intended to perform a specific task. Provides encapsulation and is also
essential to refer to the data members and access them. Consists of two parts, method
declaration and method body.

● Predefined Method: In Java, predefined methods are the method that is already
defined in the Java class libraries is known as predefined methods. It is also known as
the standard library method or built-in method. We can directly use these methods just
by calling them in the program at any point.
● User-defined Method: The method written by the user or programmer is known
as a user-defined method. These methods are modified according to the
requirement.

4.2 Constructors
Constructor in java is a special type of method that Used to construct an object of a class and
initialize it. Java constructor is invoked at the time of object creation. Rules for creating java
constructor

● Constructor name must be same as its class name


● Constructor must have no explicit return type

Types of Constructors

● Default Constructor: A default constructor is a constructor which can be called


with no arguments (either defined with an empty parameter list, or with default
arguments provided for every parameter). A type with a public default constructor
is Default Constructible.
● Parameterized Constructor: The parameterized constructors are the
constructors having a specific number of arguments to be passed. The purpose of
a parameterized constructor is to assign user-wanted specific values to the instance
variables of different objects. A parameterized constructor is written explicitly by
a programmer.

11
4.3 Method Overloading
Method overloading allows a class to define multiple methods with the same name, but
different signatures. That is, it allows you to define different methods that have the same name,
but that respond to correspondingly different messages sent to an instance of the class.

Different ways to overload the method

● By changing number of arguments


● By changing the Type (Data type)

12
5. PACKAGES IN JAVA

A package can be defined as a pack (group) of classes, interfaces and other packages. For
organizing classes and interfaces packages are used in java. Built-in packages and user-defined
packages are the types of packages. In this class notes we will learn what packages are, what
are user-defined packages in java and how to use them. In java we have several built-in
packages, for example when we need user input, we import a package like this: import
java.util.Scanner
Here:
● java is a top level package
● util is a sub package
● and Scanner is a class which is present in the sub package util. Types of packages
in Java

As mentioned in the beginning of this guide, we have two types of packages in java.

● User defined package: The package we create is called user-defined package.


● Built-in package: The already defined package like java.io., java.lang. etc are
known as built- in packages.
Subpackages A package inside another package is known as a sub package. For example
If I create a package inside let me calculate a package then that will be called sub package.
Let's say I have created another package inside let me calculate and the sub pack- age
name is multiply.
API Packages Java APl (Application Program Interface) provides a large number of
classes grouped into different packages according to functionality. Most of the time we
use the packages which are available in Java API.

13
6. PROJECT

Source Code

import java.util.Scanner;

public class Bank {

static double balance = 0;

public static void main(String[] args) {

Scanner scanner = new Scanner(System.in);

int option = 0;

while (option != 4) {

System.out.println("Welcome to the Bank of Java");

System.out.println("1. Check Balance");

System.out.println("2. Deposit");

System.out.println("3. Withdraw");

System.out.println("4. Exit");

System.out.print("Enter an option: ");

option = scanner.nextInt();

switch (option) {

case 1:

checkBalance();

break;

case 2:

14
deposit();

break;

case 3:

withdraw();

break;

case 4:

exit();

break;

default:

System.out.println("Invalid option. Try again.");

break;

public static void checkBalance() {

System.out.println("Your current balance is $" + balance);

public static void deposit() {

Scanner scanner = new Scanner(System.in);

System.out.print("Enter the amount to deposit: $");

double amount = scanner.nextDouble();

15
balance += amount;

System.out.println("$" + amount + " has been deposited to your account.");

checkBalance();

public static void withdraw() {

Scanner scanner = new Scanner(System.in);

System.out.print("Enter the amount to withdraw: $");

double amount = scanner.nextDouble();

if (amount > balance) {

System.out.println("Insufficient funds.");

} else {

balance -= amount;

System.out.println("$" + amount + " has been withdrawn from your account.");

checkBalance();

public static void exit() {

System.out.println("Thank you for banking with us. Have a great day!");

16
Output

Welcome to the Bank of Java

1. Check Balance

2. Deposit

3. Withdraw

4. Exit

Enter an option: 1

Your current balance is $0.0

Welcome to the Bank of Java

1. Check Balance

2. Deposit

3. Withdraw

4. Exit

Enter an option: 2

Enter the amount to deposit: $30000

$30000.0 has been deposited to your account.

Your current balance is $30000.0

Welcome to the Bank of Java

1. Check Balance

2. Deposit

3. Withdraw

4. Exit

Enter an option: 3

Enter the amount to withdraw: $10000

17
$10000.0 has been withdrawn from your account.

Your current balance is $20000.0

Welcome to the Bank of Java

1. Check Balance

2. Deposit

3. Withdraw

4. Exit

Enter an option: 1

Your current balance is $20000.0

Welcome to the Bank of Java

1. Check Balance

2. Deposit

3. Withdraw

4. Exit

Enter an option: 4

Thank you for banking with us. Have a great day!

18
7. CONCLUSION

Mastering Core Java is paramount for developers in their journey towards software
development excellence. This fundamental language, with its versatility and security features,
forms a robust foundation for building platform-independent solutions. Key concepts such as
the Java Virtual Machine (JVM) and Object-Oriented Programming principles provide the
necessary knowledge and skills to navigate evolving technologies. With the insights gained
from Core Java training, developers are well-equipped to meet the demands of the ever-
changing software development landscape.

19

You might also like