Yash Final Report

Download as docx, pdf, or txt
Download as docx, pdf, or txt
You are on page 1of 21

FIRST YEAR PRACTICAL TRAINING SEMINAR REPORT

INTRODUCTION TO
JAVA CORE

Submitted in partial fulfilment of the degree of Bachelor of Technology

Rajasthan Technical University


By

Yash Koolwal
(PIET18CS153)

DEPARTMENT OF COMPUTER ENGINEERING


POORNIMA INSTITUTE OF ENGINEERING AND TECHNOLOGY,JAIPUR
(Academic Year 2019-20)
RAJASTHAN TECHNICAL UNIVERSITY

POORNIMA INSTITUTE OF ENGINEERING & TECHNOLOGY,JAIPUR

CERTIFICATE

This is to certify that First Year Practical Training Seminar Report entitled
“INTRODUCTION TO JAVA CORE” has been submitted by “Yash
Koolwal(PIET18CS153), for partial fulfilment of the Degree of Bachelor of Technology
of Rajasthan Technical University. It is found satisfactory and approved for
submission.

Date: 15th July , 2019

Mr. Deepak Moud Dr. Dinesh Goyal


HOD, Director,
Dept .of Comp Engg. PIET,Jaipur
PIET,Jaipur

ii
Company Certificate to be attached

iii
DECLARATION

I hereby declare that the FIRST YEAR Industrial Training Seminar REPORT
entitled “Introduction to Java Core" was carried out and written by me under the
guidance of Mr. Aashu Sharma and Dr Rakhi Mutha, , Department of Computer
Engineering, Poornima Institute of Engineering & Technology, Jaipur. This work has not
been previously formed the basis for the award of any degree or diploma or certificate
nor has been submitted elsewhere for the award of any degree or diploma.

Place: Jaipur YASH KOOLWAL

Date: 15-July-2019 PIET18CS153

iv
ACKNOWLEDGMENT

A project of such a vast coverage cannot be realized without help from numerous sources and
people in the organization.I am thankful to Mr.Shashikant Singhi, Chairman, PGC and
Dr.Dinesh Goyal,Director, PIET for providing me a platform to carry out such a training
successfully.

I am also very grateful to Mr.Deepak Moud(HOD, CE)for his kind support.

I would like to take this opportunity to show my gratitude towards Mr. Megha Gupta & Dr.
Amit Kumar Gupta (Coordinator, PTS)who helped me in successful completion of my First
Year Practical Training.They have guided,motivated & were source of inspiration for me to
carry out then necessary proceedings for the training to be completed successfully.

I would also like to express my hearts felt appreciation to all of my friends whose direct or
indirect suggestions help me to develop this project and to entire team members for their valuable
suggestions.

Lastly,thanks to all faculty members of Computer Engineering department for their moral support
and guidance.

Submitted by:

YashKoolwal

v
ABSTRACT

Java is a Object oriented programming language which was introduced in 1990’s and still, after
being well known for 3 decades its still in high demand and is vastly used in industries and for
security purpose programs.

The training in “Core Java” made me familiar with how the applications are developed using
java and why it is still the most in demand in terms of security.
I did my training on the daily basis and after every unit covered we had to submit the
assignment related to that unit. In addition of this thorough learning about this language we
have to make some minor projects using the concepts we learned.
In the content I have explained my overall training familiarity in the last successive
months.This content is the main content that I have recorded and it contains overall work I
have been executing.

vi
Table of Contents

Description PageNo.

Certificate i
College Certificate ii
Company Certificate iii
Declaration iv
Acknowledgement v
Abstract vi
List of Table vii
Chapter 1 : COMPANY PROFILE vii
Chapter 2 : INTRODUTION TO JAVA x
2.1 What is Java? x
2.2 History of Java xi
2.3 Philosophy xi
2.4 OOPs xi
Chapter 3 : LANGUAGE FEATURES xiii
3.1 Operators xiii
3.2 Literals xiii
3.3 Loops and Conditional Statements xiv
3.4 Array xv
3.5 Class xvi
3.6 Object xvii

vii
1.7 Inheritance xviii
Chapter 4 :LIMITATIONS xx
REFERENCE xxi

Chapter 1
Company Profile

Samyak Computer Classes

About The Company-

Samyak Computer a special education vehicle to provide the expert and advance knowledge of
today and tomorrow's IT industries requirement. They provide the training with skills to
understand the topics and per second changing parameters of IT environment.

Samyak Computer classes in Jaipur is Best training institute providing training of C Language,
C++, Java and Data structures in Jaipur. We provide coaching of the programming languages
subjects of the All university's B.Tech, BCA, MCA, B.Sc. and M.Sc.(IT).

Company mission-

Our mission is to provide our students with the expert and advance knowledge of today and
tomorrow’s IT industries requirement. The contents therein are designed in a way to provide
knowledge and skill to the students in a easy-going manner.

Services-
1. Software Programming Languages

viii
2. Web Development Training
3. Basic Course Training of RSCIT, office automation, DTP

Address-
62, Kalwar Rd, Near Brij Fracture Hospital, Shivpuri, Sindhi Colony,
Jhotwara, Jaipur,
Rajasthan 302012

ix
Chapter 2
Introduction to Java
2.1 What is java?

Java is a general-purpose programming language that is class-based, object-oriented and


designed to have as few implementation dependencies as possible. The syntax of Java is
similar to C and C++, but it has fewer low-level facilities than either of them.,

Java has been used in different domains. Some of them are listed below:

 Banking: To deal with transaction management.


 Retail: Billing applications that you see in a store/restaurant are completely written in
Java.
 Information Technology: Java is designed to solve implementation dependencies.
 Android: Applications are either written in Java or use Java API.
 Financial services: It is used in server-side applications.
 Stock market: To write algorithms as to which company they should invest in.
 Big Data: Hadoop Map Reduce framework is written using Java.
 Scientific and Research Community: To deal with huge amount of data.

Java is one of the world's most widely used computer language. Java is a simple, general-
purpose, object-oriented, interpreted, secure, architecture-neutral, portable, high-performance,
multithreaded computer language. It is intended to let application developers "write once, run
anywhere" (WORA), meaning that code that runs on one platform does not need to be
recompiled to run on another.

x
2.2 History of java

Java was started as a project called "Oak" by James Gosling in June 1991. Gosling's goals were
to implement a virtual machine and a language that had a familiar C-like notation but with
greater uniformity and simplicity than C/C++. The first public implementation was Java 1.0 in
1995.

. New versions for large and small platforms (J2EE and J2ME) soon were designed with the
advent of "Java 2". Sun has not announced any plans for a "Java 3".

2.3 Philosophy
There were five primary goals in the creation of the Java language:

1. It should use the object-oriented programming methodology.


2. It should allow the same program to be executed on multiple operating systems.
3. It should contain built-in support for using computer networks.
4. It should be designed to execute code from remote sources securely.
5. It should be easy to use by selecting what was considered the good parts of other
object-oriented languages.

2.4 OOPs
Java is purely based an object oriented programming. Some features of OOPs are as
follows:
 Objects are the real world entities.
 Class is a collection of member variables(called as data) as well as member
methods(called as operations).
 Encapsulation: Bundling of member variables and member methods together in a
class as a single unit.
xi
 Data hiding: By declaring the data members as private we can hide them from
external objects.
 Data abstraction: By hiding the internal complex details of a class from external
objects we can make their work simple.
 Message passing
 Polymorphism(Method overloading)
 Data binding(Compile time binding and run time bining)

xii
Chapter 3
Language features

3.1 Operators
The entire operator is similar to the C and C++ language.

Below we have a table of all operator categorise according to their types.

All these operators have their own precedency and associativity and they have their own
definition.

3.2 Literals
The literals in java are of following type:

xiii
 Integer literals
o Byte, short, int, float
 Floating literals
o Float, double
 Character literals
o ‘a’ or ‘\u0061’ or ‘\141’
 Boolean literals
o True or false
 String literals
o “abc” , “54”

3.3 Loops and conditional statements


3.3.1 If-else statement
A condition is given in the if statement, if the condition is true then it
executes the if statement and if the condition is false then it executes the
else statement.

SYNTAX:
If(condition)
True statement;
Else
False statement;

3.3.2 While , do-while loop

While will perform a logical test, and if this results in a true condition execute
subsequent statements bounded by {} brackets.

xiv
Do while will first execute statements bounded by {} brackets and than perform a
logical test. If the logical test results in a true condition execute the statements
bounded by {} brackets again. It will be executed at least once

3.3.3 For loop

o A for loop is divided into three parts, an initialization part, a conditional part and an
increment part
o You should sett all initial values in the initialization part of the loop.
o A true from the condition part will execute subsequent statements bounded by {}
brackets. A false from the condition part will end the loop.
o For each loop the increment part will be executed.

SYNTAX:
For(initialise;condition;inc/dec)
{
statement;
}

3.4 Array
When number of variable of same type and nature are more then it is not easy to manage
them, so we need an array.
An array is a collection of homogenous elements stored continuously under a single line

Declaration : int a[];


a= new int[5];

xv
//or int a[]={10,20,30,40,50};
3.5 Classes

The building block of Java that leads to Object Oriented programming is a Class. It is a user
defined data type, which holds its own data members and member functions, which can be
accessed and used by creating an instance of that class. A class is like a blueprint for an
object.
public class MyClass {
int x = 5;
}
In general, class declarations can include these components, in order:

1. Modifiers : A class can be public or has default access.


2. Class name: The name should begin with a initial letter (capitalized by convention).
3. 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.
4. 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.

3.5.1 Class variables

A class can contain any of the following variable types.

 Local variables: Variables defined inside methods, constructors or blocks are called
local variables. The variable will be declared and initialized within the method and the
variable will be destroyed when the method has completed.

 Instance variables: Instance variables are variables within a class but outside any
method. These variables are initialized when the class is instantiated. Instance
variables can be accessed from inside any method, constructor or blocks of that
particular class.
xvi
 Class variables: Class variables are variables declared within a class, outside any
method, with the static keyword.

3.5.2 Constructors

When discussing about classes, one of the most important sub topic would be constructors.
Every class has a constructor. If we do not explicitly write a constructor for a class, the
Java compiler builds a default constructor for that class.

Each time a new object is created, at least one constructor will be invoked. The main rule
of constructors is that they should have the same name as the class. A class can have more
than one constructor.

Following is an example of a constructor:

public class sum{


public sum(){
}

Public sum(String name){


//This constructor has one parameter, name;
}
}

3.6 Objects

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 :
xvii
1. State : It is represented by attributes of an object. It also reflects the properties of an object.
2. Behaviour : It is represented by methods of an object. It also reflects the response of an
object with other objects.
3. Identity : It gives a unique name to an object and enables one object to interact with other
objects.

When an object of a class is created, the class is said to be instantiated. All the instances share
the attributes and the behaviour 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.

3.6.1 Creating an object

As mentioned previously, a class provides the blueprints for objects. So basically, an


object is created from a class. In Java, the new keyword is used to create new objects.

There are three steps when creating an object from a class −

 Declaration − A variable declaration with a variable name with an object type.

 Instantiation − The 'new' keyword is used to create the object.

 Initialization − The 'new' keyword is followed by a call to a constructor. This call


initializes the new object.

3.7 Inheritance

The capability of a class to derive properties and characteristics from another class is
called Inheritance. Inheritance is one of the most important features of Object Oriented
Programming.
Sub Class: The class that inherits properties from another class is called Sub class or
Derived Class.

xviii
Super Class: The class whose properties are inherited by sub class is called Base Class or
Super class.

Types of inheritance:
1. Single level Inheritance: - If a class B is derived from class A.
2. Multi-level Inheritance: - If a class C is derived from class B which is derived from A
3. Multiple Inheritance: - A class can inheritance the attribute of two or more classes.
Multiple inheritance is allowing.
4. Hierarchical Inheritance: - When certain features of one level are shared by many other
below that level.
5. Multipath Inheritance: - When multiple copies of a single base class is copied into a
derived class from multiple path
6. Hybrid Inheritance: - There could be situation where we need to apply two or many
types of inheritance to design a program.

xix
Chapter 4
Limitations
 Java can't have control to hardware resources like ram, processor directly as it
doesn't contains pointers. So you can't create kernel of OS, drivers etc.

 The java code running time is slower than C, that's why frameworks core is still
written in C or other low level languages.

 It doesn't have multiple inheritance

 No separation of specification from implementation: Java classes aren't divided


into specification and implementation parts.

 No enumeration types. Java lacks enumeration types entirely, although they can be
simulated by creating a series of named constants.

 No local constants. In Java, variables that belong to a class can be made constant by
declaring them to be final. Variables that are local to a method cannot be
declared final, however.
References
 Google
https://www.google.co.in
 Quora
https://www.quora.com
 W3schools
https://www.w3schools.com
 Java T Point
https://www.javatpoint.com/java-tutorial

You might also like