Internship Report 2
Internship Report 2
A Report on
Inter/Intra-institutional Internship (Course Code: 21INT49)
Report-2
Carried out at
DON BOSCO INSTITUTE OF TECHNOLOGY
BENGALURU - 560074
Submitted in partial fulfilment for
Bachelor of Engineering
In
Computer Science And Engineering
Submitted by
MAHESHWARI V
1DB21CS077
CERTIFICATE
CONTENTS:
Introduction to Java
Features of Java
JDK, JRE, JVM
Application of Java
History of Java
Object and Class in Java
Method in Java
Constructor in Java
Difference between Method and Constructor in Java
Instance Variable in Java
Java Static Keyword
Inheritance in Java
Types of inheritance in Java
Aggregation in Java
Java polymorphism
Method Overloading in Java
Method Overriding in Java
Abstraction in Java
Encapsulation in Java
Java Package
Java arrays
Data types
Variable
Operators and its types
Conclusion
INTRODUCTION TO JAVA:
3
4
Java Language was initially developed for digital devices such as set-
top boxes, televisions, etc. now it is used for various types of
application development.
4
5
FEATURES OF JAVA:
Simple:
Java is very easy to learn, and its syntax is simple, clean, and easy to
understand. Java language is a simple programming language
because, It has removed many complicated and rarely-used features,
and there is an Automatic Garbage Collection.
Object Oriented:
Platform Independent:
High Performance:
Distributed:
5
6
JDK:
Java Development Kit aka JDK is the core component of Java
Environment and provides all the tools, executables, and binaries
required to compile, debug, and execute a Java Program.
We can say that JDK is the superset of JRE since it contains JRE with
Java compiler, debugger, and core classes. JDK is a platform-specific
software and that’s why we have separate installers for Windows,
Mac, and Unix systems.
JRE:
JVM:
6
7
HISTORY:
7
8
The principles for creating java were simple, robust, secured, high
performance, portable, multi-threaded, interpreted, dynamic, etc. In
1995 Java was developed by James Gosling, who is known as the
Father of Java. Currently, Java is used in mobile devices, internet
programming, games, e-business, etc.
After the name OAK, the team decided to give a new name to it and
the suggested words were Silk, Jolt, revolutionary, DNA, dynamic,
etc. These all names were easy to spell and fun to say, but they all
wanted the name to reflect the essence of technology. In accordance
with James Gosling, Java the among the top names along with Silk,
and since java was a unique name so most of them preferred it.
8
9
OBJECT IN JAVA:
Examples:
Pencil
Apple
Book
Bag
Board
Object Definitions:
CLASS IN JAVA:
9
10
o Fields
o Methods
o Constructors
o Blocks
o Nested class and interface
A variable which is created inside the class but outside the method is
known as an instance variable. Instance variable doesn’t get memory
at compile time. It gets memory at runtime when an object or instance
is created. That is why it is known as an instance variable.
METHOD IN JAVA:
Advantage of Method:
o Code Reusability
o Code Optimization
10
11
11
12
12
13
INHERITANCE IN JAVA:
Inheritance in Java is a mechanism in which one object acquires all
the properties and behaviours of a parent object. It is an important part
of OOPs (Object Oriented programming system).
13
14
14
15
15
16
16
17
AGGREGATION IN JAVA:
If a class have an entity reference, it is known as Aggregation.
Aggregation represents HAS-A relationship.
17
18
JAVA POLYMORPHISM:
Java Polymorphism means "many forms", and it occurs when we have
many classes that are related to each other by inheritance.
Compile-time Polymorphism:
Upcasting:
18
19
19
20
20
21
METHOD OVERRIDING:
If subclass (child class) has the same method as declared in the parent
class, it is known as method overriding in Java.
The method must have the same name as in the parent class.
The method must have the same parameter as in the parent class.
There must be an IS-A relationship (inheritance).
21
22
The name and parameter of the method are the same, and there is IS-
A relationship between the classes, so there is method overriding.
ABSTRACTION IN JAVA:
Abstraction is a process of hiding the implementation details and
showing only functionality to the user.
Another way, it shows only essential things to the user and hides the
internal details, for example, sending SMS where we type the text and
22
23
send the message. We don't know the internal processing about the
message delivery.
ENCAPSULATION IN JAVA:
Encapsulation in Java is a process of wrapping code and data together
into a single unit, for example, a capsule which is mixed of several
medicines.
JAVA PACKAGE :
23
24
There are many built-in packages such as java, lang, awt, javax,
swing, net, io, util, sql etc.
Example:
JAVA ARRAYS:
24
25
Example:
25
26
DATA TYPES:
Datatype is a special keyword used to allocate sufficient memory
space for the data, in other words datatype is used for representing the
data in main memory (RAM) of the computer.
26
27
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 to identify input
data in a program.
Arithmetic Operators
Relational Operators
Logical Operators
Bitwise Operators
Assignment Operators
Ternary or Conditional Operators
27
28
CONCLUSION:
Java is an object-oriented programming language. It is a general-
purpose programming language, mainly designed to run developed
java code on all platforms that support Java without recompilation.
28
29
29
30
30