Anurag's Report
Anurag's Report
Anurag's Report
SEMINAR REPORT
ON
CORE JAVA
By
Anurag Sharma
Session 2019-2020
SEMINAR REPORT
ON
CORE JAVA
By
ANURAG SHARMA
Submitted by
Mr. ………………….
Designation
Session 2019-2020
CERTIFICATE
This is to certify that the seminar entitled “CORE JAVA” has been presented
by ANURAG SHARMA under my guidance during the academic
year 2019.
Submitted to
Mr./Ms.
TANYA………………….
ACKNOWLEDGEMENT
Computer Science and Engineering , JECRC Foundation ,Jaipur for introducing the
present topic and for their inspirational intellectual guidance , constructive criticism
Finally I would like to thank my parents for their support to complete this report.
Date – 18/10/2019
PAGE INDEX
ABSTRACT 7
1. BASIC OF JAVA
2. PROGRAMING CONCEPTS
4.1 Constructor 18
4.2 Static block 18
4.3 Relationship 19
5.1 Inheritance 19
5.2 Method overloading 20
5.3 Method overriding 20
5.4 Interface 21
5.5 Abstraction 21
5.6 Real life example 22
5.7 Encapsulation 22
5.8 Polymorphism 22
6. ADVANCED JAVA
6.1 Package 23
6.2 Exception handling 23
6.3 Multithread 24
6.4 Thread 24
6.5 String 25
6.6 Collection 25
CONCLUSION 26
REFERENCES 26
7
FIGURE INDEX
ABSTRACT
Java is one of the programming language or technology used for developing
web applications. Java language developed at SUN Micro Systems in the year
1995 under the guidance of James Gosling and there team. Originally SUN
Micro Systems is one of the Academic university (Stanford University
Network)
Whatever the software developed in the year 1990, SUN Micro Systems has
released on the name of oak, which is original name of java (scientifically
oak is one of the tree name). The OAK has taken 18 months to develop.The
oak is unable to fulfill all requirements of the industry. So James Gosling
again reviews this oak and released with the name of java in the year 1995.
Scientifically java is one of the coffee seed name.
J2SE
J2EE
J2ME
BASICS OF JAVA
Overview Of Java
Define JRE
Define JVM
Garbage Collector
Define an API
An API (Application Programming Interface) is a collection of packages,
a package is the collection of classes, interfaces and sub-packages. A sub-
package is a collection of classes interfaces and sub sub packages etc.
Definition of JIT
JIT is the set of programs developed by SUN Micro System and added as a
part of JVM, to speed up the interpretation phase
Features Of JAVA
PATH VARIABLE
Path variable is set for providing path for all java tools like java, javac,
javap, javah, jar, applet viewer which are use in java programming. These
all tools are available in bin folders so we set path up to bin folders.
CLASSPATH VARIABLE
Classpath variable is set for providing path for predefined java classes
which is used in our application. All classes are available in lib/rt.jar so we
set class path up to lib/rt.jar.
JVM, JRE, JDK these all the backbone of java language. Each components
have separate works. JDK and JRE physically exists but JVM are abstract
machine it means it not physically exists.
JRE : The Java Runtime Environment (JRE) is part of the Java Development
Kit (JDK). It contains set of libraries and tools for developing java
application. The Java Runtime Environment provides the minimum
requirements for executing a Java application. It physically exists. It contains
set of libraries + other files that JVM uses at runtime.
Object is the physical as well as logical entity where as class is the only
logical entity.
Class: Class is a blue print which is containing only list of variables and
method and no memory is allocated for them. A class is a group of objects
that has common properties.
Data Member
Method
Constructor
Block
Class and Interface
Object: Object is a instance of class, object has state and behaviors .An
Object in java has three characteristics:
State
Behavior
Identity
State: Represents data (value) of an object.
Behavior: Represents the behavior (functionality) of an object such as
deposit, withdraw etc.
Identity: Object identity is typically implemented via a unique ID. The value
of the ID is not visible to the external user. But, it is used internally by the
JVM to identify each object uniquely.
Data Types
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.
PROGRAMMING CONCEPTS
Main( ) Method
main() method is starting execution block of a java program or any java program start their
execution from main method. If any class contain main() method known as main class.
Looping Statement
for loop
While loop
do-while
Wrapper Classes
For each and every fundamental data type there exist a pre-defined class,
Such predefined class is known as wrapper class. The purpose of wrapper
class is to convert numeric string data into numerical or fundamental data.
17
Access modifiers:
Access modifiers are those which are applied before data members or
methods of a class. These are used to where to access and where not
to access the data members or methods. In java programming we
have four access modifiers they are
Final keyword
This keyword
Super keyword
Synchronized Keyword
Synchronized Keyword is used for when we want to allow only one thread at a
time then use Synchronized modifier. If a method or block declared as a
Synchronized then at a time only one thread is allowed to operate on the
given object.
19
Abstract Classes
We know that every java program must start with a concept of class that is
without classes concept there is no java program perfect .In java
programming we have two types of classes they are
1. Concrete class
2. Abstract class
Types of constructors
Static block is a set of statements, which will be executed by the JVM before execution
of main method. At the time of class loading if we want to perform any activity we have
to define that activity inside static block because static block execute at the time of class
loading. In a class we can take any number of static block but all these static block will be
execute from top to bottom.
20
Relationship in Java
Type of relationship always makes to understand how to reuse the feature from one class to
another class. In java programming we have two types of relationship they are.
Is-A Relationship
Has-A Relationship
Types of Inheritance
Single inheritance
Multiple inheritance
Hierarchical inheritance
Multilevel inheritance
Hybrid inheritance
Method Overloading
Whenever same method name is exiting multiple times in the same class
with different number of parameter or different order of parameters or
different types of parameters is known as method overloading.
Suppose we have to perform addition of given number but there can be any
number of arguments, if we write method such as a(int, int)for two
arguments, b(int, int, int) for three arguments then it is very difficult for you
and other programmer to understand purpose or behaviours of method they
can not identify purpose of method. So we use method overloading to easily
figure out the program. For example above two methods we can write
sum(int, int) and sum(int , int , int) using method overloading concept.
Method Overriding
Whenever same method name is existing in both base class and derived class
with same types of parameters or same order of parameters is known
as method Overriding.
Interface
Interface is similar to class which is collection of public static final
variables (constants) and abstract methods. The interface is a mechanism to
achieve fully abstraction in java. There can be only abstract methods in the
interface. It is used to achieve fully abstraction and multiple inheritance in
Java.
Abstraction
Abstraction is the concept of exposing only the required essential
characteristics and behaviour with respect to a context.
Hiding of data is known as data abstraction. In object oriented
programming language this is implemented automatically while writing the
code in the form of class and object.
23
Encapsulation
Encapsulation is a process of wrapping of data and methods in a single unit
is called encapsulation. Encapsulation is achieved in java language by class
concept .Combining of state and behaviour in a single container is known as
encapsulation. In java language encapsulation can be achieve
using class keyword, state represents declaration of variables on attributes
and behaviour represents operations in terms of method.
Benefits of encapsulation
Polymorphism
The process of representing one form in multiple forms is known
as Polymorphism. Here original form or original method always resides in
base class and multiple forms represents overridden method which resides in
derived classes.
JAVA ADVANCED
Package
A package is a collection of similar types of classes, interfaces and sub-
packages.
Purpose of package
Exception Handling
The process of converting system error messages into user friendly error
message is known as Exception handling. This is one of the powerful
feature of Java to handle run time error and maintain normal flow of java
application.
An Exception is an event, which occurs during the execution of a program,
that disrupts the normal flow of the program's Instructions.
25
Type of Exception
Checked Exception
Un-Checked Exception
Multithreading
Multithreading in java is a process of executing multiple threads
simultaneously. The aim of multithreading is to achieve the concurrent
execution.
Thread
1. New State
2. Ready State
3. Running State
4. Waiting State
26
String
String is a sequence of characters enclosed within double quotes (" ") is
known as String.
Example: "Java Programming".
In java programming to store the character data we have a fundamental
datatype called char. Similarly to store the string data and to perform
various operation on String data, we have three predefined classes they are:
String
StringBuffer
StringBuilder
Collection
Collections in java is a framework that provides an architecture to store and
manipulate the group of objects. All the operations that you perform on a data
such as searching, sorting, insertion, manipulation, deletion etc. can be
performed by Java Collections. Java Collection simply means a single unit of
objects. Java Collection framework provides many interfaces (Set, List,
Queue, Deque etc.) and classes (Array List, Vector, Linked List, Priority
Queue, Hash Set, Linked Hash Set, Tree Set etc).
27
CONCLUSIONS
Practical knowledge means the visualization of the knowledge, which we
read in our books. For this, we perform experiments and get observations.
Practical knowledge is very important in every field. One must be familiar
with the problems related to that field so that he may solve them and become a
successful person.
After achieving the proper goal in life, an engineer has to enter in
professional life. According to this life, he has to serve an industry, may be
public or private sector or self-own. For the efficient work in the field, he
must be well aware of the practical knowledge as well as theoretical
knowledge.
Due to all above reasons and to bridge the gap between theory and practical,
our
Engineering curriculum provides a practical training of 45 days. During this
period
a student work in the industry and get well all type of experience and
knowledge about the working of
companies and hardware and software tools.
REFERENCES
Internshala
OOPS Concept by Sumita Arora
Google Group-javatechzone