SUMMER TRAINING REPORT ON CORE JAVA UNDERTAKEN
HEWLETT PACKARD ENTERPRISE INDIA PVT LTD., NOIDA
Submitted in partial fulfillment of the requirements for the award of Degree of BACHELOR OF TECHNOLOGY In ELECTRONICS AND COMMUNICATION ENGINEERING
Training In-charge Mr. Abhinav Kumar Under the supervision of Mr. Gaurav Kumar (Senior Trainer) (15th June, 2015 – 28th July, 2015)
Submitted by: Submitted to:
Durgeshwar Singh Ms. Priyanka Kwatra
(9912102158) ( Assistant Professor)
I am grateful to Hewlett Packard Enterprise India Pvt. Ltd, Gurgaon for giving me opportunity to
carry out the project work in the area of console based portal designing during my training. I
would like to also thank my institute, Jaypee Institute of Information Technology, Noida for
giving permission and necessary administrative support to take up the training work at Hewlett
Enterprise India Pvt. Ltd, Noida.
Deepest thanks to our Trainer Mr. Gaurav Kumar(Senior Trainer) for his guidance,
monitoring, constant encouragement and correcting various assignments of ours with attention
and care. He has taken pain to go through the project and training sessions and make necessary
corrections as when needed and we are very grateful for that.
INTRODUCTION
Java is one of the programming language or technology used for developing web applications.
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 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.
Java divided into three categories, they are
J2SE J2SE is used for developing client side applications.
J2EE J2EE is used for developing server side applications.
J2ME J2ME is used for developing mobile or wireless application by making use of a predefined protocol called WAP (wireless Access / Application protocol).
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.
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;
Java Classpath Setting
Path variable is set for providing path for all java tools like java, javac, javap, javah, jar, appletviewer which are use in java programming. These all tools are available in bin folders so we set path upto bin folders.
Classpath variable is set for providing path for predefined java classes which is used in our application. All classes are available in lib/rt so we set classpath upto lib/rt.
Steps For CompilingAnd Executing Programs
The following sequence of steps represented in the diagram use compiling the java program and executing the java programs.
Difference Between JDK,JRE AND JVM
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.
Data Types Datatype is a spacial keyword used to allocate sufficient memory space for the data, in other words Data type is used for representing the data in main memory (RAM) of the computer. In general every programming language is containing three categories of data types. They are
Data Type Default Value Default size boolean false 1 bit char '\u0000' 2 byte byte 0 1 byte short 0 2 byte int 0 4 byte long 0L 8 byte float 0 4 byte
double 0 8 byte 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. 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.
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.
for loop While loop do-while
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
JAVA USEFUL KEYWORDS Final keyword In java language final keyword can be used in following way.
Static keyword
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. In java language static keyword can be used for following
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.
Static Block in Java
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. 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.
JAVA OBJECT ORIENTED
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.
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 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
Why use Inheritance?
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. Why 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 behaviors 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. Different ways to overload the method There are two ways to overload the method in java
If we do not know about any things about implementation just we have requirement specification then we should be go for Interface
If we are talking about implementation but not completely (partially implemented) then we should be go for abstract 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. Real life example of Abstraction
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
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 of state and behavior 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 behavior represents operations in terms of method. Benefits of encapsulation
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 implementations are varying from one objects oriented programming language to another object oriented programming language.
Polymorphism principal is divided into two sub principal they are:
JAVA ADVANCED Package
A package is a collection of similar types of classes, interfaces and sub-packages. Purpose of package
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.