CORE JAVA
CORE JAVA
INTRODUCTION
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
(Standford 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.
HP the largest IT company in the world, through its partner offers high quality Courses for 4 & 6
weeks. Few Courses in Summer Training Program are Programming Techniques using 'C', PHP,
VLSI, VHDL & PCB Design, Data Structure using C Language, Core Java, J2EE - Hibernate with
Spring Framework, J2EE - Struts with Hibernate Framework, Android, ASP.NET With C#,
Embedded & Robotics-Basics & Advanced, ARM, Linux Administration with Scripting, Networking
concepts with security.
lOMoARcPSD|53169051
BASICS OF JAVA
Overview Of Java
Java is a platform independent, more powerful, secure, high performance, multithreaded
programming language. Here we discuss some points related to java.
Define 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.
Define JVM
JVM is set of programs developed by sun Micro System and supplied as a part of jdk for reading
line by line of byte code and it converts into native understanding form of operating system.
Java language is one of the compiled and interpreted programming language.
Garbage Collector
Garbage Collector is the system Java program which runs in the background along with regular
Java program to collect un-Referenced (unused) memory space for improving the performance
of our applications.
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.
Java programming is containing user friendly syntax so that we can develop effective
application s. in other words if any language is providing user friendly syntax, we can develop
error free applications.
lOMoARcPSD|53169051
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
Features of a language are nothing but the set of services or facilities provided by the language
vendors to the industry programmers. Some important features are;
Classpath Variable
lOMoARcPSD|53169051
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 classpath upto 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. JVM :
JVM (Java Virtual Machine) is a software. It is a specification that provides runtime environment
in which java bytecode can be executed. It not physically exists.JVMs are not same for all
hardware and software, for example for window os JVM is different and for Linux VJM is
different. JVM, JRE and JDK are platform dependent because configuration of each OS differs.
But, Java is platform independent.
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.
lOMoARcPSD|53169051
JDK : The Java Development Kit (JDK) is primary components. It physically exists. It is
collection of programming tools and JRE, JVM.
• Data Member
• Method
• Constructor
• Block
Object: Object is a instance of class, object has state and behaviors.An Object in java has three
characteristics:
• State
• Behavior
• Identity
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
Operators And Its Types
Operator is a special symbol that tells the compiler to perform specific mathematical or logical
Operation. Java supports following lists of operators.
• Arithmetic Operators
• Relational Operators
• Logical Operators
• Bitwise Operators
• Assignment Operators
PROGRAMMING CONCEPTS
Structure Of Java Program
Structure of a java program is the standard format released by Language developer to the Industry
programmer. Sun Micro System has prescribed the following structure for the java programmers for
developing java application.
lOMoARcPSD|53169051
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.
Decision making statement statements is also called selection statement. That is depending on
the condition block need to be executed or not which is decided by condition. If the condition is
"true" statement block will be executed, if condition is "false" then statement block will not be
executed.
In java there are three types of decision making statement.
• if
• if-else
• switch
lOMoARcPSD|53169051
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.
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
The static keyword is used in java mainly for memory management. Static keyword are used
with variables, methods, blocks and nested class. Static is a keyword that are used for share the
same variable or method of a given class. This is used for a constant variable or a method that
is the same for every instance of a class. The main method of a class is generally labeled static.
3. block
4. nested class
This keyword
this is a reference variable that refers to the current object. It is a keyword in java language
represents current class object "this" keyword can be use in two ways.
Super keyword
Super keyword in java is a reference variable that is used to refer parent class object. Super is
an implicit keyword create by JVM and supply each and every java program for performing
important role in three places.
• At variable level
• At method level
• At constructor level
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.
lOMoARcPSD|53169051
2. Abstract class
Types of constructors
Based on creating objects in Java constructor are classified in two types. They are
• Parameterized constructor.
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.
lOMoARcPSD|53169051
In a class we can take any number of static block but all these static block will be execute from
top to bottom.
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
A class that is declared with abstract keyword, is known as abstract class. An abstract class is one
which is containing some defined method and some undefined method. In java programming
undefined methods are known as un-Implemented or abstract method.The process of obtaining
the data members and methods from one class to another class is known as inheritance. It
is one of the fundamental features of object-oriented programming.
Types of Inheritance
• Single inheritance
• Multiple inheritance
• Hierarchical inheritance
• Multilevel inheritance
• Hybrid inheritance
lOMoARcPSD|53169051
• It's main uses are to enable polymorphism and to be able to reuse code for different classes
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.
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 behavior
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.
Abstraction shows only important things to the user and hides the internal details for example
when we ride a bike, we only know about how to ride bike but can not know about how it work
? and also we do not know internal functionality of bike.
Encapsulation
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.
Polymorphism is not a programming concept but it is one of the principal of OOPs. For many
objects oriented programming language polymorphism principle is common but whose
lOMoARcPSD|53169051
implementations are varying from one objects oriented programming language to another object
oriented programming language.
JAVA ADVANCED
Package
A package is a collection of similar types of classes, interfaces and sub-packages.
The purpose of package concept is to provide common classes and interfaces for any program
separately. In other words if we want to develop any class or interface which is common for
most of the java programs than such common classes and interfaces must be place in a 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.
Type of Exception
lOMoARcPSD|53169051
• 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 is a lightweight components and it is a flow of control. In other words a flow of control
is known as thread.State of a thread are classified into five types they are
1. New State
2. Ready State
3. Running State
4. Waiting State
String
String is a sequence of characters enclosed within double quotes (" ") is known as String.
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 (ArrayList, Vector, LinkedList, PriorityQueue, HashSet, LinkedHashSet,
TreeSet et.
PROJECTS UNDERTAKEN
Connect Four Game : Connect Four is a two-player connection game in which the players first choose
a color and then take turns dropping colored discs from the top into a seven-column, six-row vertically
suspended grid. The pieces fall straight down, occupying the next available space within the column.
The objective of the game is to be the first to form a horizontal, vertical, or diagonal line of four of
one's own discs. Connect Four is a solved game. The first player can always win by playing the right
moves.
lOMoARcPSD|53169051
Results screenshot:
lOMoARcPSD|53169051
lOMoARcPSD|53169051
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
I have undergone my 42 days summer training in 5th sem on INTERNSHALA. This report is based
on the knowledge, which I acquired during my 42 days of summer training.
lOMoARcPSD|53169051
REFERENCES
[1] Dr. Mitali Gupta “A Study on Impact of Connect Four game in JAVA special reference to
oracle.com, IJRAR- International Journal of Research and
Analytical Reviews, vol. 6, no. 1, pp.889-893, Jan. – March 2019
[2] Dr. S. Preetha, S.Iswarya “An Analysis of User Convenience towards Connect Four game and
Software Application,” International Journal of Management,
Technology And Engineering, vol. 9, no. 1,pp.429-433, January 2019
[3] Scott Taylor, Jr. “Campus dining goes mobile: Intentions of college students to adopt a desktop
game app,” Journal of Java Business Research, vol. 24, no. 2, pp. 121- 139, March 2021
[4] Debarun Chakraborty, Ghadeer Kayal, Prashant Mehta, Robin Nunkoo & Nripendra P.
Rana (2022) “Consumers’ usage of javaFX app: a theory of consumption
values,” Journal of Hospitality Marketing & Management, vol. 3, no. 5, pp. 1-9, Jan. 2022