[go: up one dir, main page]

0% found this document useful (0 votes)
185 views19 pages

Six Week Summer Training Report: Object Oriented Programming Using Java Course Code-Cse343

The document summarizes Pritam Parida's six week summer training report on object oriented programming using Java. It includes a declaration, acknowledgements, table of contents, and sections on key concepts covered in the course like classes and objects, collections, relationships, inheritance and polymorphism. The training was conducted on the EBOX platform from April 30 to June 25, 2020 to fulfill the learning requirements for Pritam's B.Tech. degree in computer science from Lovely Professional University.

Uploaded by

ponnaganti teja
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)
185 views19 pages

Six Week Summer Training Report: Object Oriented Programming Using Java Course Code-Cse343

The document summarizes Pritam Parida's six week summer training report on object oriented programming using Java. It includes a declaration, acknowledgements, table of contents, and sections on key concepts covered in the course like classes and objects, collections, relationships, inheritance and polymorphism. The training was conducted on the EBOX platform from April 30 to June 25, 2020 to fulfill the learning requirements for Pritam's B.Tech. degree in computer science from Lovely Professional University.

Uploaded by

ponnaganti teja
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/ 19

SIX WEEK SUMMER TRAINING REPORT

on
OBJECT ORIENTED PROGRAMMING USING
JAVA
COURSE CODE-CSE343
SUBMITTED BY:-
PRITAM PARIDA
11802180
K18GX
DECLARATION

I hereby declare that I have completed my six weeks summer training on EBOX
platform from April 30,2020 to June 25,2020.I have declare that I have worked full
dedication during the 6 weeks of training and my learning outcomes fulfill the
requirements of training for the award of degree of B.tech. CSE , Lovely
Proffesional University, Phagwara.

Date – 5 Oct. 2020 Name of Student – Pritam Parida


Registration no: 11802180
ACKNOWLEDGEMENT

I would like to express my gratitude towards my University as well as EBOX for


providing me the golden opportunity to do this wonderful summer training
regarding Object Oriented Programming-JAVA, which also helped me in doing a lot
of homework and learning. As a result, I came to know about so many new things.
So, I am really thank full to them.
Moreover I would like to thank my friends who helped me a lot whenever I got
stuck in some problem related to my course. I am really thankfull to have such a
good support of them as they always have my back whenever I need.
Also,I would like to mention the support system and consideration of my parents
who have always been there in my life to make me choose right thing and oppose
the wrong. Without them I could never had learned and became a person who I am
now.
I have taken efforts in this project. However, it would not have been possible
without the kind support and help of many individuals and organizations. I would
like to extend my sincere thanks to all of them.
CERTIFICATE

SUMMER TRAINING CERTIFICATE BY EBOX


S. Title Page No.
No.
1 Ìntroduction 6

2 WHY JAVA? 7

3 Concept in the course 8

4 Learning Outcome 18

5 Reference 19
INTRODUCTION

OOP-JAVA course is a complete package that helped me to learn JAVA


PROGRAMMING from Basic to an Advance level. The course curriculm has been
divided into 6 weeks, where I practiced questions and I have attempted the
assesment tests accordingly. The course offers a wealth of programming challenges
that helped me to learn all about JAVA and making of a JAVA PROGRAMMING
and how to write code and the logic behind the Program.
The course was Self placed means I could join the course anytime and all the
content will be avilable to me once I get enrolled. There was video lectures to learn
form and multiple choice questions to practice.
I learned some good techniques for solving various problems with full flexibility of
time as I was not time bounded.
This course does not require any prior knowledge of JAVA but a basic knowledge
of any programming language ( C++ / C) will be helpful.
And as we all know OBJECT ORIENTED JAVA is a skill in terms of Placement in
any company because it helps us to increase our problem solving skill.
WHY JAVA?

All of the above was part of my training during my summer break I specially
choose the JAVA by EBOX for reasons stated below :

 I was interested in OBJECT ORIENTED PROGRAMMING since my first


semester.
 JAVA is a language you need to know no matter which stream you are in.
 It had video lectures of all the topics from which one can easily learn. I prefer
learning from video rather than books and notes. I know books and notes and
thesis have their own significance but still video lecture or face to face
lectures make it easy to understand faster as we are involved Practically.
 It had 200+ coding problems with video explaind solutions.
 It had track based learning and weekly assesment to test my skills.
 It was a great opportunity for me to invest my time in learning instead of
wasting it here and there during my summer break in this Covid-19
panademic.
 This was a life time accessable course which I can use to learn even after my
training whenever I want to revise.
 Along with all these reasons one of the reason was the EBOX platform which
is offering the course because EBOX is one of the best platform for Computer
Science Students.
CONCEPT IN THE COURSE

Classes and Objects 8-9


Collections – I 11
Relationships 12
Inheritance And 13
Polymorphism
Abstract and Interface 14
Strings 15
Exception Handling 16
Multithreading 17
CLASSES AND OBJECT
CLASS:-
A class is a user defined blueprint or prototype from which objects are created.
It represents the set of properties or methods that are common to all objects of one
type.
In general, class declarations can include these components, in order:
Modifiers: A class can be public or has default access (Refer this for details).
Class name:The name should begin with a initial letter (capitalized by convention).
Superclass(if any):The name of the class’s parent (superclass), if any, preceded by
the keyword extends. A class can only extend (subclass) one parent.
Interfaces(if any):A comma-separated list of interfaces implemented by the class,
if any, preceded by the keyword implements. A class can implement more than one
interface.
Body:The class body surrounded by braces, { }.
Constructors are used for initializing new objects. Fields are variables that provides
the state of the class and its objects, and methods are used to implement the
behavior of the class and its objects.
There are various types of classes that are used in real time applications such as
nested classes, anonymous classes, lambda expressions.

OBJECT:-
It is a basic unit of Object Oriented Programming and represents the real life
entities. A typical Java program creates many objects, which as you know, interact
by invoking methods. An object consists of following:
State : It is represented by attributes of an object. It also reflects the properties of
an object.
Behavior : It is represented by methods of an object. It also reflects the response of
an object with other objects.
Identity : It gives a unique name to an object and enables one object to interact with
other objects.
Example of an object : dog
Objects correspond to things found in the real world. For example, a graphics
program may have objects such as “circle”, “square”, “menu”. An online shopping
system might have objects such as “shopping cart”, “customer”, and “product”.
Declaring Objects (Also called instantiating a class)
When an object of a class is created, the class is said to be Instantiated. All the
instances share the attributes and the behavior of the class. But the values of those
attributes, i.e. the state are unique for each object. A single class may have any
number of instances.
COLLECTIONS-I

Almost, In every day scenarios, we handle objects / data in plural form (list or
group of objects). When we model these scenarios in our applications, We need to
define appropriate data structures and harness the existing utility methods available
as part of Java Development Kit (JDK).
There are many collection data structures and its corresponding
class implementations available in Java, like ArrayList.
RELATIONSHIP
In Java, we can reuse our code using an Is-A relationship or using a Has-A
relationship. An Is-A relationship is also known as inheritance and a Has-A
relationship is also known as composition in Java.
Is-A Relationship in Java
In Java, an Is-A relationship depends on inheritance. Further inheritance is of two
types, class inheritance and interface inheritance. It is used for code reusability in
Java. For example, a Potato is a vegetable, a Bus is a vehicle, a Bulb is an electronic
device and so on. One of the properties of inheritance is that inheritance is
unidirectional in nature. Like we can say that a house is a building. But not all
buildings are houses. We can easily determine an Is-A relationship in Java. When
there is an extends or implement keyword in the class declaration in Java, then the
specific class is said to be following the Is-A relationship.
Has-A Relationship in Java
In Java, a Has-A relationship is also known as composition. It is also used for code
reusability in Java. In Java, a Has-A relationship simply means that an instance of
one class has a reference to an instance of another class or an other instance of the
same class. For example, a car has an engine, a dog has a tail and so on. In Java,
there is no such keyword that implements a Has-A relationship. But we mostly use
new keywords to implement a Has-A relationship in Java.
INHERITANCE AND POLYMORPHISM

Inheritance is an important pillar of OOP(Object Oriented Programming). It is the


mechanism in java by which one class is allow to inherit the features(fields and
methods) of another class. It has following components:
Super Class: The class whose features are inherited is known as super class(or a
base class or a parent class).
Sub Class: The class that inherits the other class is known as sub class(or a derived
class, extended class, or child class). The subclass can add its own fields and
methods in addition to the superclass fields and methods.
Reusability: Inheritance supports the concept of “reusability”, i.e. when we want to
create a new class and there is already a class that includes some of the code that we
want, we can derive our new class from the existing class. By doing this, we are
reusing the fields and methods of the existing class.
The keyword used for inheritance is extends.
Operator Overloading: Java also provide option to overload operators. For
example, we can make the operator (‘+’) for string class to concatenate two strings.
We know that this is the addition operator whose task is to add two operands. So a
single operator ‘+’ when placed between integer operands, adds them and when
placed between string operands, concatenates them.In java, Only “+” operator can
be overloaded:
To add integers
To concatenate strings
2. Runtime polymorphism: It is also known as Dynamic Method Dispatch. It is a
process in which a function call to the overridden method is resolved at Runtime.
This type of polymorphism is achieved by Method Overriding.
Method overriding, on the other hand, occurs when a derived class has a definition
for one of the member functions of the base class. That base function is said to be
overridden.
ABSTRACT AND INTERFACE

An abstract class is a class that is declared abstract—it may or may not include
abstract methods. Abstract classes cannot be instantiated, but they can be
subclassed.
An abstract method is a method that is declared without an implementation
(without braces, and followed by a semicolon), like this:
abstract void moveTo(double deltaX, double deltaY);
If a class includes abstract methods, then the class itself must be declared
abstract, as in:

public abstract class GraphicObject


{
// declare fields
// declare nonabstract methods
abstract void draw();
}

When an abstract class is subclassed, the subclass usually provides implementations


for all of the abstract methods in its parent class. However, if it does not, then the
subclass must also be declared abstract.
An interface is a reference type in Java. It is similar to class. It is a collection of
abstract methods. A class implements an interface, thereby inheriting the abstract
methods of the interface.
Along with abstract methods, an interface may also contain constants, default
methods, static methods, and nested types. Method bodies exist only for default
methods and static methods.
Writing an interface is similar to writing a class. But a class describes the attributes
and behaviors of an object. And an interface contains behaviors that a class
implements.
Unless the class that implements the interface is abstract, all the methods of the
interface need to be defined in the class.
STRINGS

Strings, which are widely used in Java programming, are a sequence of characters.
In Java programming language, strings are treated as objects.
The Java platform provides the String class to create and manipulate strings.
Creating Strings
The most direct way to create a string is to write −
String_Greeting = “Hello World!”;
Whenever it encounters a string literal in your code, the compiler creates a String
object with its value in this case, "Hello world!'.
As with any other object, you can create String objects by using the new keyword
and a constructor. The String class has 11 constructors that allow you to provide the
initial value of the string using different sources, such as an array of characters.
EXCEPTION HANDLING

The Exception Handling in Java is one of the powerful mechanism to handle the
runtime errors so that normal flow of the application can be maintained. There are
mainly two types of exceptions: checked and unchecked. Here, an error is
considered as the unchecked exception. According to Oracle, there are three types
of exceptions:
1) Checked Exception
The classes which directly inherit Throwable class except RuntimeException and
Error are known as checked exceptions e.g. IOException, SQLException etc.
Checked exceptions are checked at compile-time.
2) Unchecked Exception
The classes which inherit RuntimeException are known as unchecked exceptions
e.g. ArithmeticException, NullPointerException,
ArrayIndexOutOfBoundsException etc. Unchecked exceptions are not checked at
compile-time, but they are checked at runtime.
3) Error
Error is irrecoverable e.g. OutOfMemoryError, VirtualMachineError,
AssertionError etc.
MULTITHREADING

Multithreading is a Java feature that allows concurrent execution of two or more


parts of a program for maximum utilization of CPU. Each part of such program is
called a thread. So, threads are light-weight processes within a process.Threads can
be created by using two mechanisms :1. Extending the Thread class2. Implementing
the Runnable Interface Thread creation by extending the Thread classWe create a
class that extends the java.lang.Thread class. This class overrides the run() method
available in the Thread class. A thread begins its life inside run() method. We create
an object of our new class and call start() method to start the execution of a thread.
Start() invokes the run() method on the Thread object.

LEARNING OUTCOMES
On completion of the course I was able to:

 Use an integrated development environment to write, compile, run, and


test simple object-oriented Java programs.
 Read and make elementary modifications to Java programs that solve
real- world problems.
 Validate input in a Java program.
 Identify and fix defects and common security issues in code.
 Document a Java program using Javadoc.
 Use a version control system to track source code in a project.
REFERENCE

 EBOX(COURSE)

 GEEKS FOR GEEKS(WEBSITE)

You might also like