Final (IR)
Final (IR)
Final (IR)
Submitted by
HARISH M
[4PS15CS039]
Dated:
Undergone Internship/course in
Q Spiders
01, Basappa Layout, Gavipuram extension, kempegowda nagar Bangalore
karnakata-560019
CONTENT
1. Acknowledgement………………………………………………………………..…i
2. Organization ………………………………………………………………………....1
3. Introduction ………………………………………………………………………...2
4. Basics Of Java……………………………………………………………………....2
4.1.Overview of Java……………………………………………………………....2
4.2.Features of Java…………………………………………………………..........3
4.3.Java Class Path Setting………………………………………………….……....4
4.4.Steps For Compiling And Executing Programs………………………………..4
4.5.Difference Between JDK, JRE and JVM…………………………..…….…....5
4.6.Object And Class………………………………………………………...……..5
4.7.Data Types………………………………………………………………...…....6
4.8.Variables………………………………………………………………………..7
4.9.Operators And Its Types…………………………………………….………….7
5. Programming Concepts……………………………………………………………...7
5.1.Structure Of Java Program……………………………………………………...7
5.2.Main Method……………………………………………………………………8
5.3.Decision Making Statement…………………………………………………….8
5.4.Looping Statement……………………………………………………………...8
5.5.Wrapper Classes………………………………………………………………...9
5.6.Access Modifiers………………………………………………………………..9
9. Java Advanced……………………………………………………………………..16
9.1.Package…………………………………………………………………………16
9.2.Exception Handling…………………………………………………………….16
9.3.Multithreading………………………………………………………………….17
9.4.String……………………………………………………………………………17
9.5.Collection……………………………………………………………………….18
ACKNOWLEDGEMENT
I am grateful to Q Spiders Training Institute, Bangalore for giving me an opportunity to
carry out the project work in the area of java based web application during my training. I would
like to thank my Institute, PES College of Engineering, and Mandya for giving permission and
necessary administrative support to take up the training work at Q Spiders Training Institute,
Bangalore.
Deepest thanks to our trainee Mr. SUNIL CHANDRA (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 made necessary
corrections as when needed and we are very grateful for that.
HARISH M
ORGANIZATION
Q Spiders is a training platform for software development and software testing that
offers various courses for Individuals and educational institutions. Q Spiders was founded in
2003. Its headquarters is located in Bangalore, Karnataka, IN 560019.
Few Courses that are present in the training program are Programming Techniques using ‘C’,
‘PHP’ ,’Core JAVA’, ‘J2EE’,’MySQL’,’HTML’, ‘CSS’, ‘JavaScript’, ‘Manual Testing’ etc.
Q Spiders also provides good placement assistance for the candidates who are looking for a
software job. It is also a preferred recruitment partner for a large number of organizations.
Reputed names in the corporate world visit the campuses on a regular basis and selects the best
from their talent pool and offers are enviable. The Institute now stands as the most preferred
destination for aspirants seeking jobs in the domain of software development and testing and it
also provide International placement services.
INTRODUCTION
Java is one of the programming language or technology used for developing with
applications. Java language was developed at SUN Micro Systems in the year 1995 under the
guidance of James Gosling and their team. Originally SUN Microsystems is one of the Academic
University
Whenever 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
J2SE is used for developing client side application.
J2EE
J2EE is used for developing server side application.
J2ME
J2ME is used for developing mobile or wireless application by making use of a
predefined protocol called WAP (Wireless Access / Application Protocol).
BASICS OF JAVA
Overview of Java:-
Define JRE
The Java Runtime Environment (JRE) is a 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 a set of programs developed by sun Micro Systems and supplied as a part of jdk
for reading line by line of byte code and it converts that into machine understandable form. 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 application.
Define API
Define JIT
JIT is the set of programs developed by SUN Micro Systems and added as a part of
JVM, to speed up the interpretation phase.
Java programming language is containing user friendly syntax so that, we can develop effective
applications. In other words, if any language is providing user friendly syntax, we can develop
error free applications.
Features of Java:-
Features of Java are nothing but a set of services provided by the language vendors to the
industry programmers. Some of the important features are:-
Features of Java
Path Variable
Path Variable is a set for providing path for all java tools like javac, javap, javah, jar
applet viewer which are used in java programming. These all tools are available in the bin
folders, so we can set path up to bin folders.
Class path variable is a set for providing path for predefined java classes which are used
in our application. All classes are available in lib/rt.jar so we can set class path up to lib/rt.jar.
Jvm, Jre and Jdk these are all the backbone of java language. Each components have
separate works. Jdk and jre physically exists, but jvm are abstract machine, it means that it does
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 windows OS, JVM is different and for Linux,
JVM is different. JVM, JRE and JDK are platform dependent because, configuration of each OS
differs. But, java is platform independent.
JRE: JRE (Java Runtime Environment) is a 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 a set of libraries + other files that JVM uses at runtime.
Object is the physical as well as a logical entity whereas, class is only a logical entity.
Class: It is a blueprint which is containing only a list of variables and methods and no memory is
allocated for them. A class is a group of objects that has common properties.
Data Member
Method
Constructor
Block
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.
Class can also be used to achieve different user defined data types.
Variable:-
Variable is an identifier which holds data or value. It is a named memory location. This
can be changed during the execution time of the program. Variable is an identifier which can be
used to identify the input data in a program.
Data Types: -
Data Type is a special 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:-
byte 0 1 byte
short 0 2 byte
Int 0 4 byte
long 0L 8 byte
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
Ternary or Conditional Operators
PROGRAMMING CONCEPTS
Structure of Java Program:-
Class is keyword used for developing user defined data type and every java program must
start with a concept of class.
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.
Syntax
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
If-then Statement
If-then is most basic statement of Decision making statement. It tells to program to execute a
certain part of code only if particular condition is true.
Syntax
If (condition)
{
Statement(s)
}
If-else statement:-
Syntax
If (condition)
{
Statement(s)
}
Else
{
Statement(s)
}
Switch Statement:-
Syntax
Switch (expression/variable)
{
Case value:
//statements
// any number of case statements
Break; //optional
Default: //optional
//statements
}
Looping Statements:-
While loop
Do While loop
For loop
While loop: -
In while loop first check the condition if condition is true then control goes inside the loop
body otherwise goes outside of the body. While loop will be repeats in clock wise direction.
A do-while loop is similar to a while loop, except that a do-while loop is execute at least
one time. A do while loop is a control flow statement that executes a block of code at least
once, and then repeatedly executes the block, or not, depending on a given condition at the end
of the block (in while).
For loop is a statement which allows code to be repeatedly executed. For loop contains 3
parts Initialization, Condition and Increment or Decrements
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 these are classified into four types:
Private
Final keyword is used to make a variable as a constant. This is similar to const in other
language. A variable declared with the final keyword cannot be modified by the program
after initialization. This is useful to universal constants, such as "PI".
It makes a method final, meaning that sub classes cannot override this method. The
compiler checks and gives an error if you try to override the method.
It makes a class final, meaning that the class cannot be inheriting by other classes.
When we want to restrict inheritance then make class as a final.
Static Keyword: -
The static keyword is used in java mainly for memory management. It is used with
variables, methods, blocks and nested class. It 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 .
This Keyword:-
This is a reference variable that refers to the current object. It is a keyword in java
language represents current class object
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.
Super keyword At Variable Level
Super keyword At Method Level
Super keyword At Constructor Level
Abstract Classes: -
We know that every java program must start with a concept of class, that is without
class’s 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: -
Based on creating objects in java, constructors are classified in two types. They are:-
Default or no argument constructor
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 this block execute at the time of class loading.
In a class we can take any number of static block but all these blocks 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 three types of relationship they are.
Is-A Relationship
Has-A Relationship
Uses-A Relationship
Is-A relationship
In Is-A relationship one class is obtaining the features of another class by using
inheritance concept with extends keywords. In a IS-A relationship there exists logical memory
space.
Has-A relationship
In Has-A relationship an object of one class is created as data member in another class
the relationship between these two classes is has-A. In Has-A relationship there existed
physical memory space and it is also known as part of or kind of relationship.
Uses-A relationship
A method of one class is using an object of another class the relationship between these
two classes is known as Uses-A relationship.
Inheritance in Java: -
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.
In the above diagram data members and methods are represented in broken line are inherited
from faculty class and they are visible in student class logically.
Types of Inheritance
Based on number of ways inheriting the feature of base class into derived class we have
five types of inheritance; they are:
Single inheritance
Multiple inheritance
Hierarchical inheritance
Multilevel inheritance
Hybrid 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.
class class_Name
{
Returntype method()
{.........}
Returntype method(datatype1 variable1)
{.........}
Returntype method(datatype1 variable1, datatype2 variable2)
{.........}
Returntype method(datatype2 variable2)
{.........}
Returntype method(datatype2 variable2, datatype1 variable1)
{.........}
}
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. Here we
will discuss about Overriding in Java.
Interface in Java: -
Abstraction in Java: -
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 bikes but cannot know about
how it work? And also we do not know the internal functionality of a bike.
Encapsulation in Java: -
The common example of encapsulation is capsule. In capsule all medicine are encapsulated in
side capsule.
Benefits of encapsulation
Polymorphism in Java: -
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.
In the above diagram the sum method which is present in BC class is called original form
and the sum () method which are present in DC1 and DC2 are called overridden form hence
Sum() method is originally available in only one form and it is further implemented in
multiple forms. Hence Sum () method is one of the polymorphism method.
JAVA ADVANCED
Package:-
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.
Type of package
Package are classified into two type which are given below.
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.
Exception
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
Checked Exception
Un-Checked Exception
Multithreading in Java:-
Thread
1. New State
2. Ready State
1. Create any user defined class and make that one as a derived class of thread class.
2. Override run() method of Thread class (It contains the logic of perform any
operation)
3. Create an object for user-defined thread class and attached that object to
predefined thread class object.
Class_Name obj=new Class_Name Thread t=new Thread (obj);
4. Call start () method of thread class to execute run () method.
5. Save the program with filename.java
The basic aim of String Handling concept is storing the string data in the main
memory (RAM), manipulating the data of the String, and retrieving the part of the String
etc. String Handling provides a lot of concepts that can be performed on a string such as
concatenation of string, comparison of string, find sub string etc.
Character:
It is an identifier enclosed within single quotes (' '). Example: 'A', '$', 'p'
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
String Buffer
String Builder
Collections in Java:-
Java Collections can achieve all the operations that you perform on a data such as searching,
sorting, insertion, manipulation, and deletion.
Java Collection means a single unit of objects. Java Collection framework provides many
interfaces (Set, List, Queue, and Deque) and classes (Array List, Vector, Linked List, Priority
Queue, Hash Set, LinkedHashSet, and Tree Set).
Let us see the hierarchy of Collection framework. The java.util package contains all the
classes and interfaces for the Collection framework.
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 the professional life. According
to this life, he has to serve an industry, may 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 30 days. During this period, a student work in
industry and get all type of experience and knowledge about the working of companies that
consists of hardware and software tools.
I have undergone my 30 days summer training in 7th semester at Q Spiders Training Institute.
This report is based on the knowledge, which I acquired during my 30 days of summer training.
REFERENCES