SlideShare ist ein Scribd-Unternehmen logo
1 von 42
Downloaden Sie, um offline zu lesen
SSUUMMMMEERR TTRRAAIINNIINNGG RREEPPOORRTT
OONN JJAAVVAA SSEE66 TTEECCHHNNOOLLOOGGYY
Mp3 music player
SUBMITTED BY SUBMITTED TO
SHAMSHER AHMED
UE113087
SUMMER TRAINING REPORT ON JAVA SE6 TECHNOLOGY 2
SHAMSHER AHMED | UE113087
2
ACKNOWLEDGEMENT
I wish to acknowledge my deep gratitude to Mr.Amrit Singh, teacher at SLR InfoTech
Pvt Ltd., for his cooperation and guidance. I am also thankful to his Lab assistant that
provided staunch support throughout this project and helped me to complete this
project.
Furthermore I would also like to acknowledge with much appreciation the crucial role
of my college Teacher Akashdeep and Mukesh Kumar, who have serious efforts in
guiding me towards programming.
And At Last I would thank my friends for helping me in this project .I have taken
serious efforts in my project efficient And if any bug and error happens, than I am
very very sorry.
SHAMSHER AHMED
SUMMER TRAINING REPORT ON JAVA SE6 TECHNOLOGY 3
SHAMSHER AHMED | UE113087
3
SUMMER TRAINING REPORT ON JAVA SE6 TECHNOLOGY 4
SHAMSHER AHMED | UE113087
4
SUMMER TRAINING REPORT ON JAVA SE6 TECHNOLOGY 5
SHAMSHER AHMED | UE113087
5
1.1 Evolution of Programming Language
The main reason for inventing the computer was to use it for scientific applications. The main
characteristics of these applications are the usage of simple data structures (such as vectors and
matrices) and intensive floating-point arithmetic. ALGOL is representative for this type of
programming languages, being specifically created for scientific applications. The efficiency of
the language was such that, even if the domain required high-performance, ALGOL surpassed
the assembly language.The following are the main domains of software programming:
 Scientific applications
 Business applications
 Artificial intelligence
 System Application
 Domain Specific
 Scripting Language
Business applications developed during the second half of the 20th century used COBOL, a
language that was created in 1960. This is also the first high-level language for business
applications. The demands imposed upon languages used in business applications are: the
capacity of producing reports, precise mechanisms for describing and storing fixed-point
numbers and strings, the efficiency of fixed-point arithmetic.
The characteristic of artificial intelligence languages is that of working with symbols
represented by names. The most frequently used data structure is the linked list. There's also the
requirement of high flexibility for the languages in this domain, thus the dynamic execution of
source code is quite frequent. The functional language LISP, created in 1965, and also its
descendants were highly used in the AI domain. An alternative was the logical programming
language PROLOG, created in early '70s.
System applications consist of the operating system and various programming instruments. Due
to their continuous use, their efficiency is crucial. Another fundamental requirement is having
access to mechanisms for the device interfaces attached to the computer. In the '60s and '70s the
languages PL/S, PL/I, BLISS and Extended ALGOL were widely used in this domain, being
almost completely replaced by C once the UNIX operating system was created. The
requirements for system applications‘ programming languages are: a level close to the assembly
language, high efficiency of the generated binary code and not imposing automated checks (such
as vector limits).
SUMMER TRAINING REPORT ON JAVA SE6 TECHNOLOGY 6
SHAMSHER AHMED | UE113087
6
Scripting languages have evolved during the last three decades. They are interpreted and
therefore highly flexible. Their evolution has started with the sh language, consisting of
commands that called system subroutines to carry out utilitarian tasks (mainly related to files).
The sh language has subsequently evolved into multiple variants such as ksh and bash. Other
examples of scripting languages are awk, tcl, Perl and JavaScript. The JavaScript language is
presently used on a large scale in dynamic Web pages.
Domain-specific languages (DSLs) were omnipresent during the last four decades. RPG used
for reporting activities, APT for programming industrial robots and GPSS for simulations are
quite representative for this domain. These languages have a restricted applicability that derives
precisely from their high degree of specialization.
The following figure depicts the evolution of the most important high-level languages, starting
with Plankalkül. It was originally presented in Concepts of Programming Languages by Robert
Sebesta and contains various enhancements based on other sources, including Computer
Languages History by Éric Lévénez .
SUMMER TRAINING REPORT ON JAVA SE6 TECHNOLOGY 7
SHAMSHER AHMED | UE113087
7
Java
At first glance, it may appear that Java was developed specifically for the World Wide Web.
However, interestingly enough, Java was developed independently of the web, and went through
several stages of metamorphosis before reaching its current status of programming language for
the World Wide Web.
According to Java FAQ, Bill Joy, currently a vice president at Sun Microsystems, is widely
believed to have been the person to conceive of the idea of a programming language that later
became Java. In late 1970's, Joy wanted to design a language that combined the best features of
MESA and C.
In an attempt to re-write the UNIX operating system in 1980's, Joy decided that C++ was
inadequate for the job. A better tool was needed to write short and effective programs. It was this
desire to invent a better programming tool that swayed Joy, in 1991, in the direction of Sun's
"Stealth Project" - as named by Scott McNealy, Sun's president.
In January of 1991, Bill Joy, James Gosling, Mike Sheridan, Patrick Naughton (formerly the
project leader of Sun's Open Windows user environment), and several other individuals met in
Aspen, Colorado for the first time to discuss the ideas for the Stealth Project. The goal of the
Stealth Project was to do research in the area of application of computers in the consumer
electronics market. The project was also named "Green" and it was started to make
microprocessors run on different machines (i.e. different platforms). Firsly, it was called
"Greentalk" by James Gosling and file extenstion was .gt.
Initially, they started to develop the project in C++, but they faced many problems as they tried
to extend the C++ compiler. During that time, James Gosling started working on a new language
called Oak which was later in 1995 renamed as Java. Why Oak? Oak is a symbol of strength
and choosen as a national tree of many countries like U.S.A, Germany etc.
The vision of the project was to develop "smart" consumer electronic devices that could all be
centrally controlled and programmed from a handheld-remote control- like device. According to
Gosling, "the goal was ... to build a system that would let us do a large, distributed,
heterogeneous network of consumer electronic devices all talking to each other." With this goal
in mind, the stealth group began work.
There were several criteria that Oak had to meet in order to satisfy the project objective given the
consumer electronics target market. Given the wide array of manufacturers in the market, Oak
would have to be completely platform independent, and function seamlessly regardless of the
type of CPU in the device.
SUMMER TRAINING REPORT ON JAVA SE6 TECHNOLOGY 8
SHAMSHER AHMED | UE113087
8
For this reason, Oak was designed to be an interpreted language, since it would be practically
impossible for a complied version to run on all available platforms. To facilitate the job of the
interpreter, Oak was to be converted to an intermediate "byte-code" format which is then passed
around across the network, and executed/interpreted dynamically.
Today, with technology such a part of our daily lives, we take it for granted that we can be
connected and access applications and content anywhere, anytime. Because of Java, we expect
digital devices to be smarter, more functional and more entertaining.
In the early 90s, extending the power of network computing to the activities of everyday life was
a radical vision. In 1991, a small group of Sun engineers called the Green Team believed that the
next wave in computing was the union of digital consumer devices and computers. Led by James
Gosling, the team worked around the clock and created the programming language that would
revolutionize our world – Java.
The Green Team demonstrated their new language with an interactive, handheld home-
entertainment controller that was originally targeted at the digital cable television industry.
Unfortunately, the concept was much too advanced for them at the time. But it was just right for
the Internet, which was just starting to take off. In 1995, the team announced that the Netscape
Navigator Internet browser would incorporate Java technology.
Today, Java not only permeates the Internet, but also is the invisible force behind many of the
applications and devices that power our day-to-day lives. From mobile phones to handheld
devises, games and navigation systems to e business solutions, Java is everywhere.
There have been significant changes to Java since the first version, called JDK 1.0, was released.
Newer versions of Java include 1.5 and 1.6 (also known as Java 5 and Java 6, respectively).
Many features in the original version are no longer used. The language has grown much bigger
as new features have been introduced in subsequent versions. Examples include the Swing and
Java 2D graphical toolkits introduced in Java 2, and the generics framework introduced in
Java 5.
SUMMER TRAINING REPORT ON JAVA SE6 TECHNOLOGY 9
SHAMSHER AHMED | UE113087
9
1.3
Mostly all the previous languages are Structured or we can say that they were procedural
programming means in them processing is to be done in sequence manner and These are also
called the Top down or either they were bottom up Languages.
OOP concentrates more on data rather the procedure to be followed or the structure of the
program. It considers data as a crucial element and work towards its security. It ties data and
functions together under a single entity called class and prevents any modification to the data by
providing access specifies .
Concepts in OOPs
Data Abstraction is that in which A User Can use any of the data and Method from the Class
Without knowing about how this is created So in other words we can say that A user use all the
Functions without Knowing about its detail For Example When a User gives Race to Car The
Car will be Moved but a User doesn‘t know how its Engine Will Work
Inheritance is very popular Concept in OOP This provides the Capability to a user to use the
Predefined Code or the code that is not created by the user himself but if he may wants to use
that code then he can use that code This is Called Inheritance but Always Remember in
Inheritance a user only using the code but he will not be able to change the code that is
previously created he can only use that code
Data Encapsulation is also known as Data Hiding as we know with the inheritance concept of
opps user can use any code that is previously created but if a user wants to use that code then it is
must that previously code must be Public as the name suggests public means for other peoples
but if a code is Private then it will be known as Encapsulate and user will not be able to use that
code So With the help of OPPS we can alter or change the code means we can make the Code as
Private or public This allows us to make our code either as public or private
Polymorphism means many and morphism means many function The Concepts Introduces in
the form of Many behaviors of an object Like an Operator + is used for Addition of Two
Numbers and + is also used for Joining two names The Polymorphism in java Introduces in the
Form of Functions Overloading and in the Form of Constructor Overloading
Dynamic Binding: Binding is used when we call the Code of the Procedure in Binding all the
Code that is Linked with the single procedure is Called When a Call is Made to that Procedure
Then the Compiler will found the Entire code of the Single Procedure if A Compiler will Fond
all the Code of Single Procedure in Compile Time then it is Called as the Early Binding
SUMMER TRAINING REPORT ON JAVA SE6 TECHNOLOGY 10
SHAMSHER AHMED | UE113087
10
Because Compiler Knows about the code at the time of Compilation but in the Late Binding
Compiler will understand all the Code at Run Time or at the Time of the Execution.
Message Communication is occurred when an object passes the Call to Method of Class for
Execution We Know for executing any method from the class First we have to create the object
of class when an object passes References to function of class then In Message Communication
First of all we have to Create the Object of the Class the we make Communication between the
Object and the Methods of the Class to the class.
1.4
 Write Once, Run Anywhere as the core value proposition of the Java platform.
Translated from business jargon, this means that the most important promise of
Java technology is that you only have to write your application once--for the Java
platform--and then you'll be able to run it anywhere.
Anywhere, that is, that supports the Java platform. Fortunately, Java support is
becoming ubiquitous. It is integrated, or being integrated, into practically all
major operating systems. It is built into the popular web browsers, which places it
on virtually every Internet-connected PC in the world. It is even being built into
consumer electronic devices, such as television set-top boxes, PDAs, and cell
phones.
 Security The Java platform allows users to download untrusted code over a
network and run it in a secure environment in which it cannot do any harm: it
cannot infect the host system with a virus, cannot read or write files from the hard
drive, and so forth. This capability alone makes the Java platform unique.
The Java 2 Platform takes the security model a step further. It makes security
levels and restrictions highly configurable and extends them beyond applets. As
of Java 1.2, any Java code, whether it is an applet, a servlet, a JavaBeans
component, or a complete Java application, can be run with restricted
permissions that prevent it from doing harm to the host system.
The security features of the Java language and platform have been subjected to
intense scrutiny by security experts around the world. Security-related bugs, some
of them potentially serious, have been found and promptly fixed. Because of the
security promises Java makes, it is big news when a new security bug is found.
Remember, however, that no other mainstream platform can make security
guarantees nearly as strong as those Java makes. If Java's security is not yet
perfect, it has been proven strong enough for practical day-to-day use and is
certainly better than any of the alternatives.
SUMMER TRAINING REPORT ON JAVA SE6 TECHNOLOGY 11
SHAMSHER AHMED | UE113087
11
 Network-centric Programming The designers of the Java platform believed in
the importance of networking and designed the Java platform to be network-
centric. From a programmer's point of view, Java makes it unbelievably easy to
work with resources across a network and to create network-based applications
using client/server or multitier architectures. This means that Java programmers
have a serious head start in the emerging network economy.
 Dynamic, Extensible Programs Java is both dynamic and extensible. Java code
is organized in modular object-oriented units called classes. Classes are stored in
separate files and are loaded into the Java interpreter only when needed. This
means that an application can decide as it is running what classes it needs and can
load them when it needs them. It also means that a program can dynamically
extend itself by loading the classes it needs to expand its functionality.
The network-centric design of the Java platform means that a Java application can
dynamically extend itself by loading new classes over a network. An application
that takes advantage of these features ceases to be a monolithic block of code.
Instead, it becomes an interacting collection of independent software components.
Thus, Java enables a powerful new metaphor of application design and
development
 Internationalization The Java language and the Java platform were designed
from the start with the rest of the world in mind. Java is the only commonly used
programming language that has internationalization features at its very core,
rather than tacked on as an afterthought. While most programming languages use
8-bit characters that represent only the alphabets of English and Western
European languages, Java uses 16-bit Unicode characters that represent the
phonetic alphabets and ideographic character sets of the entire world. Java's
internationalization features are not restricted to just low-level character
representation, however. The features permeate the Java platform, making it
easier to write internationalized programs with Java than it is with any other
environment.
 Performance Java programs are compiled to a portable intermediate form known
as byte codes, rather than to native machine-language instructions. The Java
Virtual Machine runs a Java program by interpreting these portable byte-code
instructions. This architecture means that Java programs are faster than programs
or scripts written in purely interpreted languages, but they are typically slower
than C and C++ programs compiled to native machine language. Keep in mind,
however, that although Java programs are compiled to byte code, not all of the
Java platform is implemented with interpreted byte codes. For efficiency,
computationally intensive portions of the Java platform--such as the string-
manipulation methods--are implemented using native machine code.
Although early releases of Java suffered from performance problems, the speed of
the Java VM has improved dramatically with each new release. The VM has been
SUMMER TRAINING REPORT ON JAVA SE6 TECHNOLOGY 12
SHAMSHER AHMED | UE113087
12
highly tuned and optimized in many significant ways. Furthermore, many
implementations include a just-in-time compiler, which converts Java byte
codes to native machine instructions on the fly. Using sophisticated JIT
compilers, Java programs can execute at speeds comparable to the speeds of
native C and C++ applications.
Java is a portable, interpreted language; Java programs run almost as fast as
native, non-portable C and C++ programs. Performance used to be an issue that
made some programmers avoid using Java. Now, with the improvements made in
Java 1.2, performance issues should no longer keep anyone away. In fact, the
winning combination of performance plus portability is a unique feature no other
language can offer
In every programming language we start with hello world program .Now let us see hello world
program in Java.
public class MyFirstJavaProgram {
public static void main(String []args) {
System.out.println("Hello World");
}
}
SUMMER TRAINING REPORT ON JAVA SE6 TECHNOLOGY 13
SHAMSHER AHMED | UE113087
13
Some important points while designing a Java program
 Case Sensitivity Java is case sensitive which means identifier Hello and hello
would have different meaning in Java. Class Names - For all class names the first
letter should be in Upper Case. If several words are used to form a name of the
class each inner words first letter should be in Upper Case.
Example class MyFirstJavaClass
 Method Names All method names should start with a Lower Case letter. If
several words are used to form the name of the method, then each inner word's
first letter should be in Upper Case.
Example public void myMethodName ()
 Program File Name - Name of the program file should exactly match the class
name. When saving the file you should save it using the class name (Remember
java is case sensitive) and append '.java' to the end of the name. (if the file name
and the class name do not match your program will not compile).
Example- Assume 'MyFirstJavaProgram' is the class name. Then the file should
be saved as 'MyFirstJavaProgram.java'
 public static void main(String args[]) - java program processing starts from the
main() method which is a mandatory part of every java program..
All Java components require names. Names used for classes, variables and methods are called
identifiers. In java there are several points to remember about identifiers. They are as follows:
 All identifiers should begin with a letter (A to Z or a to z), currency character ($)
or an underscore (_).
 After the first character identifiers can have any combination of characters.
 A key word cannot be used as an identifier.
 Identifiers are case sensitive.
Examples of legal identifiers: age, $salary, _value, __1_value
Examples of illegal identifiers: 123abc, -salary
These reserved words may not be used as constant or variable or any other identifier names.Java
has about 49 keywords.
SUMMER TRAINING REPORT ON JAVA SE6 TECHNOLOGY 14
SHAMSHER AHMED | UE113087
14
Java has very flexible three looping mechanisms. You can use one of the following three loops:
 while Loop
 do...while Loop
 for Loop
Syntax
 while loop
while(Boolean_expression){
//Statements
}
 for loop
for(initialization; Boolean_expression; update){
/ /Statements
SUMMER TRAINING REPORT ON JAVA SE6 TECHNOLOGY 15
SHAMSHER AHMED | UE113087
15
}
The flow of control in a for loop:
 The initialization step is executed first, and only once. This step allows you to declare
and initialize any loop control variables. You are not required to put a statement here, as
long as a semicolon appears.
 Next, the Boolean expression is evaluated. If it is true, the body of the loop is executed. If
it is false, the body of the loop does not execute and flow of control jumps to the next
statement past the for loop.
 After the body of the for loop executes, the flow of control jumps back up to the update
statement. This statement allows you to update any loop control variables. This statement
can be left blank, as long as a semicolon appears after the Boolean expression.
 The Boolean expression is now evaluated again. If it is true, the loop executes and the
process repeats itself (body of loop, then update step, then Boolean expression). After the
Boolean expression is false, the for loop terminates.
 do while
do{
//Statements
}while(Boolean_expression);
There are two types of decision making statements in Java. They are:
 if statements
 switch statements
 The if Statement:
An if statement consists of a Boolean expression followed by one or more statements.
SUMMER TRAINING REPORT ON JAVA SE6 TECHNOLOGY 16
SHAMSHER AHMED | UE113087
16
Syntax:
if(Boolean_expression){
//Statements will execute if the Boolean expression is true}
If the Boolean expression evaluates to true then the block of code inside the if statement will
beexecuted. If not the first set of code after the end of the if statement (after the closing curly
brace) will be executed.
 if...else Statement:
An if statement can be followed by an optional else statement, which executes when the Boolean
expression is false.
Syntax:
If (Boolean expression){
//Executes when the Boolean expression is true;}
else {
//Executes when the Boolean expression is false}
 if...else if...else Statement:
An if statement can be followed by an optional else if...else statement, which is very
useful to test various conditions using single if...else if statement.
When using if , else if , else statements there are few points to keep in mind.
An if can have zero or one else's and it must come after any else if's.
An if can have zero to many else if's and they must come before the else.
Once an else if succeeds, none of the remaining else if's or else's will be tested.Syntax:
if(Boolean_expression 1){
//Executes when the Boolean expression 1 is true
}else if(Boolean_expression 2){
//Executes when the Boolean expression 2 is true
}else if(Boolean_expression 3){
//Executes when the Boolean expression 3 is true
}else {
//Executes when the none of the above condition is true.
}
The switch Statement
A switch statement allows a variable to be tested for equality against a list of values. Each value
is called a case, and the variable being switched on is checked for each case.
SUMMER TRAINING REPORT ON JAVA SE6 TECHNOLOGY 17
SHAMSHER AHMED | UE113087
17
Syntax:
switch(expression){
case value :
//Statements
break; //optional
case value :
//Statements
break; //optional
//You can have any number of case statements.
default : //Optional
//Statement}
The following rules apply to a switch statement:
 The variable used in a switch statement can only be a byte, short, int, or char.
 You can have any number of case statements within a switch. Each case is followed by
the value to be compared to and a colon.
 The value for a case must be the same data type as the variable in the switch and it must
be a constant or a literal.
 When the variable being switched on is equal to a case, the statements following that case
will execute until a break statement is reached.
 When a break statement is reached, the switch terminates, and the flow of control jumps
to the next line following the switch statement.
 Not every case needs to contain a break. If no break appears, the flow of control will fall
through to subsequent cases until a break is reached.
A switch statement can have an optional default case, which must appear at the end of the
switch. The default case can be used for performing a task when none of the cases is true. No
break is needed in the default case.
Example:
public class Test {
public static void main(String args[]){
char grade = 'C';
switch(grade)
{
case 'A' :
System.out.println("Excellent!");
break;
case 'B' :
case 'C' :
System.out.println("Well done");
break;
case 'D' :
SUMMER TRAINING REPORT ON JAVA SE6 TECHNOLOGY 18
SHAMSHER AHMED | UE113087
18
System.out.println("You passed");
case 'F' :
System.out.println("Better try again");
break;
default :
System.out.println("Invalid grade");
}
System.out.println("Your grade is " + grade);
}
}
Compile and run
$ java Test
Well done
Your grade is a C
Strings, which are widely used in Java programming, are a sequence of characters. In the Java
programming language, strings are objects.
Creating Strings
The most direct way to create a string is to write:
String greeting = "Hello world!";
Whenever it encounters a string literal in your code, the compiler creates a String object with its
value in this case, "Hello world!'.As with any other object, you can create String objects by using
the new keyword and a constructor. The String class has eleven constructors that allow you to
provide the initial value of the string using different sources, such as an array of characters.
public class StringDemo{
public static void main(String args[]){
char[] helloArray = { 'h', 'e', 'l', 'l', 'o', '.'};
String helloString = new String(helloArray);
System.out.println( helloString );
}
SUMMER TRAINING REPORT ON JAVA SE6 TECHNOLOGY 19
SHAMSHER AHMED | UE113087
19
Some Basic String class methods are
S No String class Methods
1
char charAt(int index)
Returns the character at the specified index.
2
int compareTo(Object o)
Compares this String to another Object.
3
int compareTo(String anotherString)
Compares two strings lexicographically.
4
int compareToIgnoreCase(String str)
Compares two strings lexicographically, ignoring case differences.
5
String concat(String str)
Concatenates the specified string to the end of this string.
6
boolean contentEquals(StringBuffer sb)
Returns true if and only if this String represents the same sequence of characters as the specified
StringBuffer.
7
static String copyValueOf(char[] data)
Returns a String that represents the character sequence in the array specified.
8
static String copyValueOf(char[] data, int offset, int count)
Returns a String that represents the character sequence in the array specified.
9
boolean endsWith(String suffix)
Tests if this string ends with the specified suffix.
10
boolean equals(Object anObject)
Compares this string to the specified object.
11
boolean equalsIgnoreCase(String anotherString)
Compares this String to another String, ignoring case considerations.
12
byte getBytes()
Encodes this String into a sequence of bytes using the platform's default charset, storing the result into a
new byte array.
13
byte[] getBytes(String charsetName
Encodes this String into a sequence of bytes using the named charset, storing the result into a new byte
array.
14
void getChars(int srcBegin, int srcEnd, char[] dst, int dstBegin)
Copies characters from this string into the destination character array.
15
int hashCode()
Returns a hash code for this string.
16
int indexOf(int ch)
Returns the index within this string of the first occurrence of the specified character.
17
int indexOf(int ch, int fromIndex)
Returns the index within this string of the first occurrence of the specified character, starting the search at
the specified index.
18
int indexOf(String str)
Returns the index within this string of the first occurrence of the specified substring.
19
int indexOf(String str, int fromIndex)
Returns the index within this string of the first occurrence of the specified substring, starting at the
specified index.
A Java method is a collection of statements that are grouped together to perform an operation.
When you call the System.out.println method, for example, the system actually executes several
statements in order to display a message on the console.
SUMMER TRAINING REPORT ON JAVA SE6 TECHNOLOGY 20
SHAMSHER AHMED | UE113087
20
Main difference between methods and function is method always declared and defined inside
the class while function may or may not declared inside the class.
Creating a Method
A method has the following syntax:
modifier returnValueType methodName(list of parameters) {
// Method body;
}
A method definition consists of a method header and a method body. Here are all the parts of a
method:
 The modifier, which is optional, tells the compiler how to call the method. This defines
the access type of the method.
 A method may return a value. The returnValueType is the data type of the value the
method returns. Some methods perform the desired operations without returning a value.
In this case, the returnValueType is the keyword void.
 This is the actual name of the method. The method name and the parameter list together
constitute the method signature.
 A parameter is like a placeholder. When a method is invoked, you pass a value to the
parameter. This value is referred to as actual parameter or argument. The parameter list
refers to the type, order, and number of the parameters of a method. Parameters are
optional; that is, a method may contain no parameters.
 Method Body: The method body contains a collection of statements that define what the
method does.
SUMMER TRAINING REPORT ON JAVA SE6 TECHNOLOGY 21
SHAMSHER AHMED | UE113087
21
The java.io package contains nearly every class you might ever need to perform input and
output (I/O) in Java. All these streams represent an input source and an output destination. The
stream in the java.io package supports many data such as primitives, Object, localized characters,
etc.
A stream can be defined as a sequence of data. The InputStream is used to read data from a
source and the OutputStream is used for writing data to a destination.
Java does provide strong, flexible support for I/O as it relates to files and networks .
Reading from Console
Java input console is accomplished by reading from System.in. To obtain a character-based
stream that is attached to the console, you wrap System.in in a BufferedReader object, to create a
character stream. Here is most common syntax to obtain BufferedReader:
BufferedReader br = new BufferedReader(new InputStreamReader(System.in));
Reading char and String from console
Once BufferedReader is obtained, we can use read( ) method to reach a character or readLine( )
method to read a stri import java.io.*;
public class BRReadLines {
public static void main(String args[]) throws IOException {
// Create a BufferedReader using System.in
BufferedReader br = new BufferedReader(new InputStreamReader(System.in));
String str; char ch;
System.out.println("Enter lines of text.");
System.out.println("Enter 'end' to quit.");
ch=(char)br.read();
do {
str = br.readLine();
SUMMER TRAINING REPORT ON JAVA SE6 TECHNOLOGY 22
SHAMSHER AHMED | UE113087
22
System.out.println(str);
} while(!str.equals("end"));System.out.println(―Input Character =‖+ch);
}
}
An exception is a problem that arises during the execution of a program. An exception can occur
for many different reasons, including the following:
 A user has entered invalid data.
 A file that needs to be opened cannot be found.
 A network connection has been lost in the middle of communications or the JVM has run
out of memory.
In java exception handling are three types
 A checked exception is an exception that is typically a user error or a problem that
cannot be foreseen by the programmer. For example, if a file is to be opened, but the
file cannot be found, an exception occurs. These exceptions cannot simply be ignored
at the time of compilation.
 A runtime exception is an exception that occurs that probably could have been
avoided by the programmer. As opposed to checked exceptions, runtime exceptions
are ignored at the time of compilation.
 These are not exceptions at all, but problems that arise beyond the control of the user
or the programmer. Errors are typically ignored in your code because you can rarely
do anything about an error. For example, if a stack overflow occurs, an error will
arise. They are also ignored at the time of compilation.
Exception Hierarchy
All exception classes are subtypes of the java.lang.Exception class. The exception class is a
subclass of the Throwable class. Other than the exception class there is another subclass
called Error which is derived from the Throwable class.
Errors are not normally trapped form the Java programs. These conditions normally happen
in case of severe failures, which are not handled by the java programs. Errors are generated
to indicate errors generated by the runtime environment. Example : JVM is out of Memory.
Normally programs cannot recover from errors.
SUMMER TRAINING REPORT ON JAVA SE6 TECHNOLOGY 23
SHAMSHER AHMED | UE113087
23
The Exception class has two main subclasses: IOException class and RuntimeException
Class
SUMMER TRAINING REPORT ON JAVA SE6 TECHNOLOGY 24
SHAMSHER AHMED | UE113087
24
Writing object-oriented programs involves creating classes, creating objects from those classes,
and creating applications, which are stand-alone executable programs that use those objects.
A class is a template, blueprint, or contract that defines what an object‘s data fields and methods
will be. An object is an instance of a class. So we can create many instances of a class. A Java
class uses variables to define data fields and methods to define actions. Additionally, a class
provides methods of a special type, known as constructors, which are invoked to create a new
object. A constructor can perform any action, but constructors are designed to perform
initializing actions, such as initializing the data fields of objects
Objects are key to understanding object-oriented technology. Look around right now and you'll
find many examples of real-world objects: your dog, your desk, your television set, your bicycle.
Real-world objects share two characteristics: They all have state and behavior. Dogs have state
(name, color, breed, hungry) and behavior (barking, fetching, wagging tail). Bicycles also have
state (current gear, current pedal cadence, current speed) and behavior (changing gear, changing
pedal cadence, applying brakes). Identifying the state and behavior for real-world objects is a
great way to begin thinking in terms of object-oriented programming.
Take a minute right now to observe the real-world objects that are in your immediate area. For
each object that you see, ask yourself two questions: "What possible states can this object be in?"
and "What possible behavior can this object perform?". Make sure to write down your
observations. As you do, you'll notice that real-world objects vary in complexity; your desktop
lamp may have only two possible states (on and off) and two possible behaviors (turn on, turn
off), but your desktop radio might have additional states (on, off, current volume, current station)
and behavior (turn on, turn off, increase volume, decrease volume, seek, scan, and tune). You
may also notice that some objects, in turn, will also contain other objects. These real-world
observations all translate into the world of object-oriented programming
Software Object
SUMMER TRAINING REPORT ON JAVA SE6 TECHNOLOGY 25
SHAMSHER AHMED | UE113087
25
Software objects are conceptually similar to real-world objects: they too consist of state and
related behavior. An object stores its state in fields (variables in some programming languages)
and exposes its behavior through methods (functions in some programming languages). Methods
operate on an object's internal state and serve as the primary mechanism for object-to-object
communication. Hiding internal state and requiring all interaction to be performed through an
object's methods is known as data encapsulation — a fundamental principle of object-oriented
programming.
In the real world, you'll often find many individual objects all of the same kind. There may be
thousands of other bicycles in existence, all of the same make and model. Each bicycle was built
from the same set of blueprints and therefore contains the same components. In object-oriented
terms, we say that your bicycle is an instance of the class of objects known as bicycles. A class is
the blueprint from which individual objects are created.
The following Bicycle class is one possible implementation of a bicycle:
class Bicycle {
int cadence = 0;
int speed = 0;
int gear = 1;
void changeCadence(int newValue) {
cadence = newValue;
}
void changeGear(int newValue) {
gear = newValue;
}
void speedUp(int increment) {
speed = speed + increment;
}
SUMMER TRAINING REPORT ON JAVA SE6 TECHNOLOGY 26
SHAMSHER AHMED | UE113087
26
void applyBrakes(int decrement) {
speed = speed - decrement;
}
void printStates() {
System.out.println("cadence:" +cadence + " speed:" + speed + " gear:" + gear);
}
}
The fields cadence, speed, and gear represent the object's state, and the methods
(changeCadence, changeGear, speedUp etc.) define its interaction with the outside world.
Object-oriented programming allows classes to inherit commonly used state and behavior from
other classes. In this example, Bicycle now becomes the superclass of MountainBike, RoadBike,
and TandemBike. In the Java programming language, each class is allowed to have one direct
superclass, and each superclass has the potential for an unlimited
A hierarchy of Bicycle class
In the Java programming language, an interface is a reference type, similar to a class, that can
contain only constants, method signatures, and nested types. There are no method bodies.
SUMMER TRAINING REPORT ON JAVA SE6 TECHNOLOGY 27
SHAMSHER AHMED | UE113087
27
Interfaces cannot be instantiated—they can only be implemented by classes or extended by other
interface.
Interfaces have another very important role in the Java programming language. Interfaces are not
part of the class hierarchy, although they work in combination with classes. The Java
programming language does not permit multiple inheritance (inheritance is discussed later in this
lesson), but interfaces provide an alternative.
In Java, a class can inherit from only one class but it can implement more than one interface.
Therefore, objects can have multiple types: the type of their own class and the types of all the
interfaces that they implement. This means that if a variable is declared to be the type of an
interface, its value can reference any object that is instantiated from any class that implements
the interfaces.
Encapsulation is a mechanism where the data and the code that acts on the data will bind
together.
For example ,if we take a class we write the variable and methods inside the class .Thus class is
binding them together .So class is an example of encapsulation.
The variable and methods of a class are called members of the class .Generally the variable in the
class are decided by using a keyword ‗private‘ .This means the variables are not directly
available to any other class .The class or method which are declared ‗public‘ can be used and
directly called from any where .
class Employee{
private int id=10;
String name=‖Shamsher‖
String Roll=‖UE113087‖
Void display(){
System.out.println(―Id of Student ‖+id);
}
}
class DEMO extends Employee {
SUMMER TRAINING REPORT ON JAVA SE6 TECHNOLOGY 28
SHAMSHER AHMED | UE113087
28
void display(){
Employee ob1=new Employee();
System.out.println(―Roll no of Student‖+ob1.Roll);
System.out.println(―Name of Student‖+ob1.name);
ob1.display();
}
The polymorphism represents the ability to assume several forms. In Java we can use the single
variable to refer to objects of different types and thus using that variable we can all the methods
of the different objects .Thus a method call can perform different tasks depending upon the type
of objects.
Polymorphism provides flexibility in writing programs in such way that the programmer uses
same method call to perform different operation depending upon the requirements.
Class one{
int a;
int b;
void one(int in){
a=in;
b=9;
}
void one(int in,int ou){
a=in;
b=ou;
}
}
SUMMER TRAINING REPORT ON JAVA SE6 TECHNOLOGY 29
SHAMSHER AHMED | UE113087
29
Abstraction refer to act of representing only those information which are necessary while hiding
details of the program.The main advantage of Abstraction is that every user will get view of data
according to his needs while hiding the details of the project ,which might confused him when
he see the whole data as whole
Mostly all object oriented language support Data Abstraction Like Java ,C++. support Data
Abstraction Like Java ,C++.
SUMMER TRAINING REPORT ON JAVA SE6 TECHNOLOGY 30
SHAMSHER AHMED | UE113087
30
The JDBC API is a Java API that can access any kind of tabular data, especially data stored in a
Relational Database.
JDBC helps you to write Java applications that manage these three programming activities
 Connect to a data source, like a database
 Send queries and update statements to the database
 Retrieve and process the results received from the database in answer to your query
JDBC includes four components:
 The JDBC API — The JDBC™ API provides programmatic access to relational data
from the Java™ programming language. Using the JDBC API, applications can execute
SQL statements, retrieve results, and propagate changes back to an underlying data
source. The JDBC API can also interact with multiple data sources in a distributed,
heterogeneous environment. The JDBC API is part of the Java platform, which includes
the Java™ Standard Edition (Java™ SE ) and the Java™ Enterprise Edition (Java™ EE).
The JDBC 4.0 API is divided into two packages: java.sql and javax.sql. Both packages
are included in the Java SE and Java EE platforms.
 JDBC Driver Manager — The JDBC DriverManager class defines objects which can
connect Java applications to a JDBC driver. DriverManager has traditionally been the
backbone of the JDBC architecture. It is quite small and simple . The Standard Extension
packages javax.naming and javax.sql let you use a DataSource object registered with a
Java Naming and Directory Interface™ (JNDI) naming service to establish a connection
with a data source. You can use either connecting mechanism, but using a DataSource
object is recommended whenever possible.
 JDBC Test Suite — The JDBC driver test suite helps you to determine that JDBC drivers
will run your program. These tests are not comprehensive or exhaustive, but they do
exercise many of the important features in the JDBC API.
 JDBC-ODBC Bridge — The Java Software bridge provides JDBC access via ODBC
drivers. Note that you need to load ODBC binary code onto each client machine that uses
this driver. As a result, the ODBC driver is most appropriate on a corporate network
where client installations are not a major problem, or for application server code written
in Java in a three-tier architecture
SUMMER TRAINING REPORT ON JAVA SE6 TECHNOLOGY 31
SHAMSHER AHMED | UE113087
31
5.1 Mp3 music player
Music player is mp3 player which is purely built in Java .And this project relies heavily on Java
Sound API .
5.1.1 Software Development life cycle
The software development life cycle (SDLC) is a conceptual model used in project management
that describes the stages involved in an information system development project, from an initial
feasibility study through maintenance of the completed application/product.
Understand the relationship between development, test activities and work products in the
Development life cycle and give examples based on project and product characteristics and
context.
Recognize the fact that software development models must be adapted to the context of project
and product characteristics.
SUMMER TRAINING REPORT ON JAVA SE6 TECHNOLOGY 32
SHAMSHER AHMED | UE113087
32
Recall reasons for different levels of testing and characteristics of good testing in any life cycle
model.
5.1.2 Waterfall models
The waterfall model is a popular version of the systems development life cycle model for
software engineering. Often considered the classic approach to the systems development life
cycle, the waterfall model describes a development method that is linear and sequential.
Waterfall development has distinct goals for each phase of development. Imagine a waterfall on
the cliff of a steep mountain. Once the water has flowed over the edge of the cliff and has begun
its journey down the side of the mountain, it cannot turn back. It is the same with waterfall
development. Once a phase of development is completed, the development proceeds to the next
phase and there is no turning back.
History of Waterfall Model
In 1970 Royce proposed what is now popularly referred to as the waterfall model as an initial
concept, a model which he argued was flawed (Royce 1970). His paper then explored how the
initial model could be developed into an iterative model, with feedback from each phase
influencing previous phases, similar to many methods used widely and highly regarded by many
today.
SUMMER TRAINING REPORT ON JAVA SE6 TECHNOLOGY 33
SHAMSHER AHMED | UE113087
33
Despite Royce's intentions for the waterfall model to be modified into an iterative model, use of
the "waterfall model" as a purely sequential process is still popular, and, for some, the phrase
"waterfall model" has since come to refer to any approach to software creation which is seen as
inflexible and non-iterative.
When to use the waterfall model:
 Requirements are very well known, clear and fixed.
 Product definition is stable.
 Technology is understood.
 There are no ambiguous requirements
Advantages of Waterfall Model
 Simple and easy to understand and use.
 Easy to manage due to the rigidity of the model – each phase has specific deliverables
and a review process.
 Phases are processed and completed one at a time.
 Works well for smaller projects where requirements are very well understood.
Disadvantages of Waterfall Model
 Once an application is in the testing stage, it is very difficult to go back and change
something that was not well-thought out in the concept stage.
 No working software is produced until late during the life cycle.
 High amounts of risk and uncertainty.
SUMMER TRAINING REPORT ON JAVA SE6 TECHNOLOGY 34
SHAMSHER AHMED | UE113087
34
 Not a good model for complex and object-oriented projects.
 Poor model for long and ongoing projects.
 Not suitable for the projects where requirements are at a moderate to high risk of
changing.
5.1.3 Requirement of this Project
Hardware Requirement
 Pentium powered Processor- speed 2.1 Ghz
 RAM - 1GB
 Hard Disk - 20 GB
 Key Board -
 Standard Windows Keyboard Mouse
 Monitor - LED
Software Requirement
 Java Development Kit version 1.6
 Neatbeans version7.01
 Operating System type Windows 7/Debian 7
Library used In this Project
 JLayer1.0.1
 Java Sound Api
JLayer 1.0.1
JLayer is a library that decodes/plays/converts MPEG 1/2/2.5 Layer 1/2/3 (i.e. MP3) in real time
for the JAVA(tm) platform. This is a non-commercial project and is licensed under LGPL.
To play mp3 in through JLayer JLayer, Tritonus and MP3SPI librairies are available in your
CLASSPATH. It means that you have jl1.0.1.jar, tritonus_share.jar, mp3spi1.9.5.jar in your
CLASSPATH.
List of Classes Available in JLayer
 javazoom/jl/converter/Converter
 javazoom/jl/converter/RiffFile
 javazoom/jl/converter/WaveFile
 javazoom/jl/converter/WaveFileObuffer
 javazoom/jl/converter/jlc
 javazoom/jl/decoder/BitReserve
 javazoom/jl/decoder/Bitstream
SUMMER TRAINING REPORT ON JAVA SE6 TECHNOLOGY 35
SHAMSHER AHMED | UE113087
35
 javazoom/jl/decoder/BitstreamErrors
 javazoom/jl/decoder/BitstreamException
 javazoom/jl/decoder/Control
 javazoom/jl/decoder/Crc16
 javazoom/jl/decoder/Decoder
 javazoom/jl/decoder/DecoderErrors
 javazoom/jl/decoder/DecoderException
 javazoom/jl/decoder/Equalizer
 javazoom/jl/decoder/FrameDecoder
 javazoom/jl/decoder/Header
 javazoom/jl/decoder/InputStreamSource
 javazoom/jl/decoder/JavaLayerError
 javazoom/jl/decoder/JavaLayerErrors
 javazoom/jl/decoder/JavaLayerException
 javazoom/jl/decoder/JavaLayerHook
 javazoom/jl/decoder/JavaLayerUtils
 javazoom/jl/decoder/LayerIDecoder
 javazoom/jl/decoder/LayerIIDecoder
 javazoom/jl/decoder/LayerIIIDecoder
 javazoom/jl/decoder/Manager
 javazoom/jl/decoder/Obuffer
 javazoom/jl/decoder/OutputChannels
 javazoom/jl/decoder/SampleBuffer
 javazoom/jl/decoder/Source
 javazoom/jl/decoder/SynthesisFilter
 javazoom/jl/decoder/huffcodetab
 javazoom/jl/player/AudioDevice
 javazoom/jl/player/AudioDeviceBase
 javazoom/jl/player/AudioDeviceFactory
 javazoom/jl/player/FactoryRegistry
 javazoom/jl/player/JavaSoundAudioDevice
 javazoom/jl/player/JavaSoundAudioDeviceFactory
 javazoom/jl/player/NullAudioDevice
 javazoom/jl/player/Player
 javazoom/jl/player/PlayerApplet
 javazoom/jl/player/advanced/AdvancedPlayer
 javazoom/jl/player/advanced/PlaybackEvent
 javazoom/jl/player/advanced/PlaybackListener
 javazoom/jl/player/advanced/jlap
 javazoom/jl/player/jlp
SUMMER TRAINING REPORT ON JAVA SE6 TECHNOLOGY 36
SHAMSHER AHMED | UE113087
36
5.1.4 Design Of The Project
This music player project is divided into
 Organisation
 Player
 Playlist
 Utility
 Interface
5.1.5 Testing
Software testing is an investigation conducted to provide stakeholders with information about the
quality of the product or service under test.Software testing can also provide an objective,
independent view of the software to allow the business to appreciate and understand the risks of
software implementation. Test techniques include, but are not limited to the process of executing
a program or application with the intent of finding software bugs (errors or other defects).
Software testing can be stated as the process of validating and verifying that a computer
program/application/product:
 meets the requirements that guided its design and development,
 works as expected,
 can be implemented with the same characteristics,
 and satisfies the needs of stakeholders.
SUMMER TRAINING REPORT ON JAVA SE6 TECHNOLOGY 37
SHAMSHER AHMED | UE113087
37
Testing methods
 Static vs. dynamic testing
There are many approaches to software testing. Reviews, walkthroughs, or inspections
are referred to as static testing, whereas actually executing programmed code with a
given set of test cases is referred to as dynamic testing. Static testing can be omitted, and
in practice often is. Dynamic testing takes place when the program itself is used.
Dynamic testing may begin before the program is 100% complete in order to test
particular sections of code and are applied to discrete functions or modules. Typical
techniques for this are either using stubs/drivers or execution from a debugger
environment.
Static testing involves verification whereas dynamic testing involves validation. Together
they help improve software quality.
 The box approach
Software testing methods are traditionally divided into white- and black-box testing.
These two approaches are used to describe the point of view that a test engineer takes
when designing test cases.
White Box
White-box testing (also known as clear box testing, glass box testing, transparent box
testing and structural testing) tests internal structures or workings of a program, as
opposed to the functionality exposed to the end-user. In white-box testing an internal
perspective of the system, as well as programming skills, are used to design test cases.
The tester chooses inputs to exercise paths through the code and determine the
appropriate outputs. This is analogous to testing nodes in a circuit, e.g. in-circuit testing
(ICT).
While white-box testing can be applied at the unit, integration and system levels of the
software testing process, it is usually done at the unit level. It can test paths within a unit,
paths between units during integration, and between subsystems during a system–level
test. Though this method of test design can uncover many errors or problems, it might not
detect unimplemented parts of the specification or missing requirements.
Techniques used in white-box testing include:
 API testing (application programming interface) – testing of the application using
public and private APIs
 Code coverage – creating tests to satisfy some criteria of code coverage (e.g., the
test designer can create tests to cause all statements in the program to be executed
at least once)
 Fault injection methods – intentionally introducing faults to gauge the efficacy of
testing strategies
 Mutation testing methods
 Static testing methods
 Code coverage tools can evaluate the completeness of a test suite that was created
with any method, including black-box testing. This allows the software team to
examine parts of a system that are rarely tested and ensures that the most
SUMMER TRAINING REPORT ON JAVA SE6 TECHNOLOGY 38
SHAMSHER AHMED | UE113087
38
important function points have been tested.Code coverage as a software metric
can be reported as a percentage for:
Black Box
Black-box testing treats the software as a "black box", examining functionality
without any knowledge of internal implementation. The tester is only aware of
what the software is supposed to do, not how it does it. Black-box testing methods
include: equivalence partitioning, boundary value analysis, all-pairs testing, state
transition tables, decision table testing, fuzz testing, model-based testing, use case
testing, exploratory testing and specification-based testing.
Specification-based testing aims to test the functionality of software according to
the applicable requirements.This level of testing usually requires thorough test
cases to be provided to the tester, who then can simply verify that for a given
input, the output value (or behavior), either "is" or "is not" the same as the
expected value specified in the test case. Test cases are built around specifications
and requirements, i.e., what the application is supposed to do. It uses external
descriptions of the software, including specifications, requirements, and designs
to derive test cases. These tests can be functional or non-functional, though
usually functional.
Specification-based testing may be necessary to assure correct functionality, but it
is insufficient to guard against complex or high-risk situations.
One advantage of the black box technique is that no programming knowledge is
required. Whatever biases the programmers may have had, the tester likely has a
different set and may emphasize different areas of functionality. On the other
hand, black-box testing has been said to be "like a walk in a dark labyrinth
without a flashlight."Because they do not examine the source code, there are
situations when a tester writes many test cases to check something that could have
been tested by only one test case, or leaves some parts of the program untested.
This method of test can be applied to all levels of software testing: unit,
integration, system and acceptance. It typically comprises most if not all testing at
higher levels, but can also dominate unit testing as well.
The aim of visual testing is to provide developers with the ability to examine
what was happening at the point of software failure by presenting the data in such
a way that the developer can easily find the information he or she requires, and the
information is expressed clearly.
At the core of visual testing is the idea that showing someone a problem (or a test
failure), rather than just describing it, greatly increases clarity and understanding.
Visual testing therefore requires the recording of the entire test process –
capturing everything that occurs on the test system in video format. Output videos
SUMMER TRAINING REPORT ON JAVA SE6 TECHNOLOGY 39
SHAMSHER AHMED | UE113087
39
are supplemented by real-time tester input via picture-in-a-picture webcam and
audio commentary from microphones.
Visual testing provides a number of advantages. The quality of communication is
increased dramatically because testers can show the problem (and the events
leading up to it) to the developer as opposed to just describing it and the need to
replicate test failures will cease to exist in many cases. The developer will have
all the evidence he or she requires of a test failure and can instead focus on the
cause of the fault and how it should be fixed.
Visual testing is particularly well-suited for environments that deploy agile
methods in their development of software, since agile methods require greater
communication between testers and developers and collaboration within small
teams.
Ad hoc testing and exploratory testing are important methodologies for checking
software integrity, because they require less preparation time to implement, while
the important bugs can be found quickly. In ad hoc testing, where testing takes
place in an improvised, impromptu way, the ability of a test tool to visually record
everything that occurs on a system becomes very important.
Visual testing is gathering recognition in customer acceptance and usability
testing, because the test can be used by many individuals involved in the
development process. For the customer, it becomes easy to provide detailed bug
reports and feedback, and for program users, visual testing can record user actions
on screen, as well as their voice and image, to provide a complete picture at the
time of software failure for the developer.
Testing levels
 Unit testing, also known as component testing, refers to tests that verify the functionality
of a specific section of code, usually at the function level. In an object-oriented
environment, this is usually at the class level, and the minimal unit tests include the
constructors and destructors.
These types of tests are usually written by developers as they work on code (white-box
style), to ensure that the specific function is working as expected. One function might
have multiple tests, to catch corner cases or other branches in the code. Unit testing alone
cannot verify the functionality of a piece of software, but rather is used to assure that the
building blocks the software uses work independently of each other.
Unit testing is a software development process that involves synchronized application of
a broad spectrum of defect prevention and detection strategies in order to reduce software
development risks, time, and costs. It is performed by the software developer or engineer
during the construction phase of the software development lifecycle. Rather than replace
traditional QA focuses, it augments it. Unit testing aims to eliminate construction errors
SUMMER TRAINING REPORT ON JAVA SE6 TECHNOLOGY 40
SHAMSHER AHMED | UE113087
40
before code is promoted to QA; this strategy is intended to increase the quality of the
resulting software as well as the efficiency of the overall development and QA process.
 Integration testing is any type of software testing that seeks to verify the interfaces
between components against a software design. Software components may be integrated
in an iterative way or all together ("big bang"). Normally the former is considered a better
practice since it allows interface issues to be located more quickly and fixed.Integration
testing works to expose defects in the interfaces and interaction between integrated
components (modules). Progressively larger groups of tested software components
corresponding to elements of the architectural design are integrated and tested until the
software works as a system
 System testing tests a completely integrated system to verify that it meets its
requirements.
In addition, the software testing should ensure that the program, as well as working as
expected, does not also destroy or partially corrupt its operating environment or cause
other processes within that environment to become inoperative (this includes not
corrupting shared memory, not consuming or locking up excessive resources and leaving
any parallel processes unharmed by its presence
 Acceptance testing can mean one of two things:
 A smoke test is used as an acceptance test prior to introducing a new build to the
main testing process, i.e. before integration or regression.
 Acceptance testing performed by the customer, often in their lab environment on
their own hardware, is known as user acceptance testing (UAT). Acceptance
testing may be performed as part of the hand-off process between any two phases
of development
Alpha testing is simulated or actual operational testing by potential users/customers
or an independent test team at the developers' site. Alpha testing is often employed
for off-the-shelf software as a form of internal acceptance testing, before the software
goes to beta testing
Beta testing comes after alpha testing and can be considered a form of external user
acceptance testing. Versions of the software, known as beta versions, are released to
a limited audience outside of the programming team. The software is released to
groups of people so that further testing can ensure the product has few faults or bugs.
Sometimes, beta versions are made available to the open public to increase the
feedback field to a maximal number of future users
SUMMER TRAINING REPORT ON JAVA SE6 TECHNOLOGY 41
SHAMSHER AHMED | UE113087
41
5.1.4 Memory Analysis
Snapshots of Memory Usage In Java
SUMMER TRAINING REPORT ON JAVA SE6 TECHNOLOGY 42
SHAMSHER AHMED | UE113087
42
5.2 Conclusion

Weitere ähnliche Inhalte

Was ist angesagt?

Genesis and Overview of Java
Genesis and Overview of Java Genesis and Overview of Java
Genesis and Overview of Java
Ravi_Kant_Sahu
 
Object-Oriented Programming in Java.pdf
Object-Oriented Programming in Java.pdfObject-Oriented Programming in Java.pdf
Object-Oriented Programming in Java.pdf
Bharath Choudhary
 
Car Game - Final Year Project
Car Game - Final Year ProjectCar Game - Final Year Project
Car Game - Final Year Project
Vivek Naskar
 

Was ist angesagt? (20)

Introduction to Java
Introduction to JavaIntroduction to Java
Introduction to Java
 
Summer training presentation on "CORE JAVA".
Summer training presentation on "CORE JAVA".Summer training presentation on "CORE JAVA".
Summer training presentation on "CORE JAVA".
 
project on snake game in c language
project on snake game in c languageproject on snake game in c language
project on snake game in c language
 
Java Programming for Designers
Java Programming for DesignersJava Programming for Designers
Java Programming for Designers
 
Generations of programming_language.kum_ari11-1-1-1
Generations of programming_language.kum_ari11-1-1-1Generations of programming_language.kum_ari11-1-1-1
Generations of programming_language.kum_ari11-1-1-1
 
Introduction to java
Introduction to javaIntroduction to java
Introduction to java
 
Java
JavaJava
Java
 
Genesis and Overview of Java
Genesis and Overview of Java Genesis and Overview of Java
Genesis and Overview of Java
 
Java Programming
Java ProgrammingJava Programming
Java Programming
 
Presentation on Core java
Presentation on Core javaPresentation on Core java
Presentation on Core java
 
Mobinius : Mobile Native vs Cross Platform
Mobinius : Mobile Native vs Cross PlatformMobinius : Mobile Native vs Cross Platform
Mobinius : Mobile Native vs Cross Platform
 
Snake game powerpoint presentation by rohit malav
Snake game powerpoint presentation by rohit malavSnake game powerpoint presentation by rohit malav
Snake game powerpoint presentation by rohit malav
 
Core java
Core java Core java
Core java
 
Introduction to basics of java
Introduction to basics of javaIntroduction to basics of java
Introduction to basics of java
 
Training report of C language
Training report of C languageTraining report of C language
Training report of C language
 
Android Project Presentation
Android Project PresentationAndroid Project Presentation
Android Project Presentation
 
Object-Oriented Programming in Java.pdf
Object-Oriented Programming in Java.pdfObject-Oriented Programming in Java.pdf
Object-Oriented Programming in Java.pdf
 
JAVA PPT by NAVEEN TOKAS
JAVA PPT by NAVEEN TOKASJAVA PPT by NAVEEN TOKAS
JAVA PPT by NAVEEN TOKAS
 
Training on Core java | PPT Presentation | Shravan Sanidhya
Training on Core java | PPT Presentation | Shravan SanidhyaTraining on Core java | PPT Presentation | Shravan Sanidhya
Training on Core java | PPT Presentation | Shravan Sanidhya
 
Car Game - Final Year Project
Car Game - Final Year ProjectCar Game - Final Year Project
Car Game - Final Year Project
 

Ähnlich wie Summer training report on java se6 technology

Unit 4 Assignment 1 Comparative Study Of Programming...
Unit 4 Assignment 1 Comparative Study Of Programming...Unit 4 Assignment 1 Comparative Study Of Programming...
Unit 4 Assignment 1 Comparative Study Of Programming...
Carmen Sanborn
 
Java [modo de compatibilidad]
Java [modo de compatibilidad]Java [modo de compatibilidad]
Java [modo de compatibilidad]
gilber255
 

Ähnlich wie Summer training report on java se6 technology (20)

Unit 4 Assignment 1 Comparative Study Of Programming...
Unit 4 Assignment 1 Comparative Study Of Programming...Unit 4 Assignment 1 Comparative Study Of Programming...
Unit 4 Assignment 1 Comparative Study Of Programming...
 
History Of C Essay
History Of C EssayHistory Of C Essay
History Of C Essay
 
Unit ii oo design 9
Unit ii oo design 9Unit ii oo design 9
Unit ii oo design 9
 
about java
about javaabout java
about java
 
Story of java
Story of javaStory of java
Story of java
 
Story of java
Story of javaStory of java
Story of java
 
Java report by ravi raja
Java report by ravi rajaJava report by ravi raja
Java report by ravi raja
 
Programming landuages
Programming landuagesProgramming landuages
Programming landuages
 
Which programming language should you learn next?
Which programming language should you learn next? Which programming language should you learn next?
Which programming language should you learn next?
 
Programming languages
Programming languagesProgramming languages
Programming languages
 
Computer languages
Computer languagesComputer languages
Computer languages
 
rlanguage-201216152504.pptx
rlanguage-201216152504.pptxrlanguage-201216152504.pptx
rlanguage-201216152504.pptx
 
Java application-development
Java application-developmentJava application-development
Java application-development
 
R language
R languageR language
R language
 
Key Features Of The Pseudo Code
Key Features Of The Pseudo CodeKey Features Of The Pseudo Code
Key Features Of The Pseudo Code
 
Java As A Programming Language
Java As A Programming LanguageJava As A Programming Language
Java As A Programming Language
 
Innovation in CS/IT via Open Source Software
Innovation in CS/IT via Open Source SoftwareInnovation in CS/IT via Open Source Software
Innovation in CS/IT via Open Source Software
 
Software Developer's Journal - 02/2012
Software Developer's Journal - 02/2012Software Developer's Journal - 02/2012
Software Developer's Journal - 02/2012
 
Java [modo de compatibilidad]
Java [modo de compatibilidad]Java [modo de compatibilidad]
Java [modo de compatibilidad]
 
Java
JavaJava
Java
 

Kürzlich hochgeladen

Hospital management system project report.pdf
Hospital management system project report.pdfHospital management system project report.pdf
Hospital management system project report.pdf
Kamal Acharya
 
Integrated Test Rig For HTFE-25 - Neometrix
Integrated Test Rig For HTFE-25 - NeometrixIntegrated Test Rig For HTFE-25 - Neometrix
Integrated Test Rig For HTFE-25 - Neometrix
Neometrix_Engineering_Pvt_Ltd
 
1_Introduction + EAM Vocabulary + how to navigate in EAM.pdf
1_Introduction + EAM Vocabulary + how to navigate in EAM.pdf1_Introduction + EAM Vocabulary + how to navigate in EAM.pdf
1_Introduction + EAM Vocabulary + how to navigate in EAM.pdf
AldoGarca30
 
Kuwait City MTP kit ((+919101817206)) Buy Abortion Pills Kuwait
Kuwait City MTP kit ((+919101817206)) Buy Abortion Pills KuwaitKuwait City MTP kit ((+919101817206)) Buy Abortion Pills Kuwait
Kuwait City MTP kit ((+919101817206)) Buy Abortion Pills Kuwait
jaanualu31
 
Verification of thevenin's theorem for BEEE Lab (1).pptx
Verification of thevenin's theorem for BEEE Lab (1).pptxVerification of thevenin's theorem for BEEE Lab (1).pptx
Verification of thevenin's theorem for BEEE Lab (1).pptx
chumtiyababu
 

Kürzlich hochgeladen (20)

data_management_and _data_science_cheat_sheet.pdf
data_management_and _data_science_cheat_sheet.pdfdata_management_and _data_science_cheat_sheet.pdf
data_management_and _data_science_cheat_sheet.pdf
 
Block diagram reduction techniques in control systems.ppt
Block diagram reduction techniques in control systems.pptBlock diagram reduction techniques in control systems.ppt
Block diagram reduction techniques in control systems.ppt
 
GEAR TRAIN- BASIC CONCEPTS AND WORKING PRINCIPLE
GEAR TRAIN- BASIC CONCEPTS AND WORKING PRINCIPLEGEAR TRAIN- BASIC CONCEPTS AND WORKING PRINCIPLE
GEAR TRAIN- BASIC CONCEPTS AND WORKING PRINCIPLE
 
Online food ordering system project report.pdf
Online food ordering system project report.pdfOnline food ordering system project report.pdf
Online food ordering system project report.pdf
 
Hospital management system project report.pdf
Hospital management system project report.pdfHospital management system project report.pdf
Hospital management system project report.pdf
 
A Study of Urban Area Plan for Pabna Municipality
A Study of Urban Area Plan for Pabna MunicipalityA Study of Urban Area Plan for Pabna Municipality
A Study of Urban Area Plan for Pabna Municipality
 
Integrated Test Rig For HTFE-25 - Neometrix
Integrated Test Rig For HTFE-25 - NeometrixIntegrated Test Rig For HTFE-25 - Neometrix
Integrated Test Rig For HTFE-25 - Neometrix
 
1_Introduction + EAM Vocabulary + how to navigate in EAM.pdf
1_Introduction + EAM Vocabulary + how to navigate in EAM.pdf1_Introduction + EAM Vocabulary + how to navigate in EAM.pdf
1_Introduction + EAM Vocabulary + how to navigate in EAM.pdf
 
Unleashing the Power of the SORA AI lastest leap
Unleashing the Power of the SORA AI lastest leapUnleashing the Power of the SORA AI lastest leap
Unleashing the Power of the SORA AI lastest leap
 
COST-EFFETIVE and Energy Efficient BUILDINGS ptx
COST-EFFETIVE  and Energy Efficient BUILDINGS ptxCOST-EFFETIVE  and Energy Efficient BUILDINGS ptx
COST-EFFETIVE and Energy Efficient BUILDINGS ptx
 
Thermal Engineering-R & A / C - unit - V
Thermal Engineering-R & A / C - unit - VThermal Engineering-R & A / C - unit - V
Thermal Engineering-R & A / C - unit - V
 
Computer Lecture 01.pptxIntroduction to Computers
Computer Lecture 01.pptxIntroduction to ComputersComputer Lecture 01.pptxIntroduction to Computers
Computer Lecture 01.pptxIntroduction to Computers
 
Tamil Call Girls Bhayandar WhatsApp +91-9930687706, Best Service
Tamil Call Girls Bhayandar WhatsApp +91-9930687706, Best ServiceTamil Call Girls Bhayandar WhatsApp +91-9930687706, Best Service
Tamil Call Girls Bhayandar WhatsApp +91-9930687706, Best Service
 
Thermal Engineering Unit - I & II . ppt
Thermal Engineering  Unit - I & II . pptThermal Engineering  Unit - I & II . ppt
Thermal Engineering Unit - I & II . ppt
 
Kuwait City MTP kit ((+919101817206)) Buy Abortion Pills Kuwait
Kuwait City MTP kit ((+919101817206)) Buy Abortion Pills KuwaitKuwait City MTP kit ((+919101817206)) Buy Abortion Pills Kuwait
Kuwait City MTP kit ((+919101817206)) Buy Abortion Pills Kuwait
 
Design For Accessibility: Getting it right from the start
Design For Accessibility: Getting it right from the startDesign For Accessibility: Getting it right from the start
Design For Accessibility: Getting it right from the start
 
AIRCANVAS[1].pdf mini project for btech students
AIRCANVAS[1].pdf mini project for btech studentsAIRCANVAS[1].pdf mini project for btech students
AIRCANVAS[1].pdf mini project for btech students
 
Verification of thevenin's theorem for BEEE Lab (1).pptx
Verification of thevenin's theorem for BEEE Lab (1).pptxVerification of thevenin's theorem for BEEE Lab (1).pptx
Verification of thevenin's theorem for BEEE Lab (1).pptx
 
HOA1&2 - Module 3 - PREHISTORCI ARCHITECTURE OF KERALA.pptx
HOA1&2 - Module 3 - PREHISTORCI ARCHITECTURE OF KERALA.pptxHOA1&2 - Module 3 - PREHISTORCI ARCHITECTURE OF KERALA.pptx
HOA1&2 - Module 3 - PREHISTORCI ARCHITECTURE OF KERALA.pptx
 
Unit 4_Part 1 CSE2001 Exception Handling and Function Template and Class Temp...
Unit 4_Part 1 CSE2001 Exception Handling and Function Template and Class Temp...Unit 4_Part 1 CSE2001 Exception Handling and Function Template and Class Temp...
Unit 4_Part 1 CSE2001 Exception Handling and Function Template and Class Temp...
 

Summer training report on java se6 technology

  • 1. SSUUMMMMEERR TTRRAAIINNIINNGG RREEPPOORRTT OONN JJAAVVAA SSEE66 TTEECCHHNNOOLLOOGGYY Mp3 music player SUBMITTED BY SUBMITTED TO SHAMSHER AHMED UE113087
  • 2. SUMMER TRAINING REPORT ON JAVA SE6 TECHNOLOGY 2 SHAMSHER AHMED | UE113087 2 ACKNOWLEDGEMENT I wish to acknowledge my deep gratitude to Mr.Amrit Singh, teacher at SLR InfoTech Pvt Ltd., for his cooperation and guidance. I am also thankful to his Lab assistant that provided staunch support throughout this project and helped me to complete this project. Furthermore I would also like to acknowledge with much appreciation the crucial role of my college Teacher Akashdeep and Mukesh Kumar, who have serious efforts in guiding me towards programming. And At Last I would thank my friends for helping me in this project .I have taken serious efforts in my project efficient And if any bug and error happens, than I am very very sorry. SHAMSHER AHMED
  • 3. SUMMER TRAINING REPORT ON JAVA SE6 TECHNOLOGY 3 SHAMSHER AHMED | UE113087 3
  • 4. SUMMER TRAINING REPORT ON JAVA SE6 TECHNOLOGY 4 SHAMSHER AHMED | UE113087 4
  • 5. SUMMER TRAINING REPORT ON JAVA SE6 TECHNOLOGY 5 SHAMSHER AHMED | UE113087 5 1.1 Evolution of Programming Language The main reason for inventing the computer was to use it for scientific applications. The main characteristics of these applications are the usage of simple data structures (such as vectors and matrices) and intensive floating-point arithmetic. ALGOL is representative for this type of programming languages, being specifically created for scientific applications. The efficiency of the language was such that, even if the domain required high-performance, ALGOL surpassed the assembly language.The following are the main domains of software programming:  Scientific applications  Business applications  Artificial intelligence  System Application  Domain Specific  Scripting Language Business applications developed during the second half of the 20th century used COBOL, a language that was created in 1960. This is also the first high-level language for business applications. The demands imposed upon languages used in business applications are: the capacity of producing reports, precise mechanisms for describing and storing fixed-point numbers and strings, the efficiency of fixed-point arithmetic. The characteristic of artificial intelligence languages is that of working with symbols represented by names. The most frequently used data structure is the linked list. There's also the requirement of high flexibility for the languages in this domain, thus the dynamic execution of source code is quite frequent. The functional language LISP, created in 1965, and also its descendants were highly used in the AI domain. An alternative was the logical programming language PROLOG, created in early '70s. System applications consist of the operating system and various programming instruments. Due to their continuous use, their efficiency is crucial. Another fundamental requirement is having access to mechanisms for the device interfaces attached to the computer. In the '60s and '70s the languages PL/S, PL/I, BLISS and Extended ALGOL were widely used in this domain, being almost completely replaced by C once the UNIX operating system was created. The requirements for system applications‘ programming languages are: a level close to the assembly language, high efficiency of the generated binary code and not imposing automated checks (such as vector limits).
  • 6. SUMMER TRAINING REPORT ON JAVA SE6 TECHNOLOGY 6 SHAMSHER AHMED | UE113087 6 Scripting languages have evolved during the last three decades. They are interpreted and therefore highly flexible. Their evolution has started with the sh language, consisting of commands that called system subroutines to carry out utilitarian tasks (mainly related to files). The sh language has subsequently evolved into multiple variants such as ksh and bash. Other examples of scripting languages are awk, tcl, Perl and JavaScript. The JavaScript language is presently used on a large scale in dynamic Web pages. Domain-specific languages (DSLs) were omnipresent during the last four decades. RPG used for reporting activities, APT for programming industrial robots and GPSS for simulations are quite representative for this domain. These languages have a restricted applicability that derives precisely from their high degree of specialization. The following figure depicts the evolution of the most important high-level languages, starting with Plankalkül. It was originally presented in Concepts of Programming Languages by Robert Sebesta and contains various enhancements based on other sources, including Computer Languages History by Éric Lévénez .
  • 7. SUMMER TRAINING REPORT ON JAVA SE6 TECHNOLOGY 7 SHAMSHER AHMED | UE113087 7 Java At first glance, it may appear that Java was developed specifically for the World Wide Web. However, interestingly enough, Java was developed independently of the web, and went through several stages of metamorphosis before reaching its current status of programming language for the World Wide Web. According to Java FAQ, Bill Joy, currently a vice president at Sun Microsystems, is widely believed to have been the person to conceive of the idea of a programming language that later became Java. In late 1970's, Joy wanted to design a language that combined the best features of MESA and C. In an attempt to re-write the UNIX operating system in 1980's, Joy decided that C++ was inadequate for the job. A better tool was needed to write short and effective programs. It was this desire to invent a better programming tool that swayed Joy, in 1991, in the direction of Sun's "Stealth Project" - as named by Scott McNealy, Sun's president. In January of 1991, Bill Joy, James Gosling, Mike Sheridan, Patrick Naughton (formerly the project leader of Sun's Open Windows user environment), and several other individuals met in Aspen, Colorado for the first time to discuss the ideas for the Stealth Project. The goal of the Stealth Project was to do research in the area of application of computers in the consumer electronics market. The project was also named "Green" and it was started to make microprocessors run on different machines (i.e. different platforms). Firsly, it was called "Greentalk" by James Gosling and file extenstion was .gt. Initially, they started to develop the project in C++, but they faced many problems as they tried to extend the C++ compiler. During that time, James Gosling started working on a new language called Oak which was later in 1995 renamed as Java. Why Oak? Oak is a symbol of strength and choosen as a national tree of many countries like U.S.A, Germany etc. The vision of the project was to develop "smart" consumer electronic devices that could all be centrally controlled and programmed from a handheld-remote control- like device. According to Gosling, "the goal was ... to build a system that would let us do a large, distributed, heterogeneous network of consumer electronic devices all talking to each other." With this goal in mind, the stealth group began work. There were several criteria that Oak had to meet in order to satisfy the project objective given the consumer electronics target market. Given the wide array of manufacturers in the market, Oak would have to be completely platform independent, and function seamlessly regardless of the type of CPU in the device.
  • 8. SUMMER TRAINING REPORT ON JAVA SE6 TECHNOLOGY 8 SHAMSHER AHMED | UE113087 8 For this reason, Oak was designed to be an interpreted language, since it would be practically impossible for a complied version to run on all available platforms. To facilitate the job of the interpreter, Oak was to be converted to an intermediate "byte-code" format which is then passed around across the network, and executed/interpreted dynamically. Today, with technology such a part of our daily lives, we take it for granted that we can be connected and access applications and content anywhere, anytime. Because of Java, we expect digital devices to be smarter, more functional and more entertaining. In the early 90s, extending the power of network computing to the activities of everyday life was a radical vision. In 1991, a small group of Sun engineers called the Green Team believed that the next wave in computing was the union of digital consumer devices and computers. Led by James Gosling, the team worked around the clock and created the programming language that would revolutionize our world – Java. The Green Team demonstrated their new language with an interactive, handheld home- entertainment controller that was originally targeted at the digital cable television industry. Unfortunately, the concept was much too advanced for them at the time. But it was just right for the Internet, which was just starting to take off. In 1995, the team announced that the Netscape Navigator Internet browser would incorporate Java technology. Today, Java not only permeates the Internet, but also is the invisible force behind many of the applications and devices that power our day-to-day lives. From mobile phones to handheld devises, games and navigation systems to e business solutions, Java is everywhere. There have been significant changes to Java since the first version, called JDK 1.0, was released. Newer versions of Java include 1.5 and 1.6 (also known as Java 5 and Java 6, respectively). Many features in the original version are no longer used. The language has grown much bigger as new features have been introduced in subsequent versions. Examples include the Swing and Java 2D graphical toolkits introduced in Java 2, and the generics framework introduced in Java 5.
  • 9. SUMMER TRAINING REPORT ON JAVA SE6 TECHNOLOGY 9 SHAMSHER AHMED | UE113087 9 1.3 Mostly all the previous languages are Structured or we can say that they were procedural programming means in them processing is to be done in sequence manner and These are also called the Top down or either they were bottom up Languages. OOP concentrates more on data rather the procedure to be followed or the structure of the program. It considers data as a crucial element and work towards its security. It ties data and functions together under a single entity called class and prevents any modification to the data by providing access specifies . Concepts in OOPs Data Abstraction is that in which A User Can use any of the data and Method from the Class Without knowing about how this is created So in other words we can say that A user use all the Functions without Knowing about its detail For Example When a User gives Race to Car The Car will be Moved but a User doesn‘t know how its Engine Will Work Inheritance is very popular Concept in OOP This provides the Capability to a user to use the Predefined Code or the code that is not created by the user himself but if he may wants to use that code then he can use that code This is Called Inheritance but Always Remember in Inheritance a user only using the code but he will not be able to change the code that is previously created he can only use that code Data Encapsulation is also known as Data Hiding as we know with the inheritance concept of opps user can use any code that is previously created but if a user wants to use that code then it is must that previously code must be Public as the name suggests public means for other peoples but if a code is Private then it will be known as Encapsulate and user will not be able to use that code So With the help of OPPS we can alter or change the code means we can make the Code as Private or public This allows us to make our code either as public or private Polymorphism means many and morphism means many function The Concepts Introduces in the form of Many behaviors of an object Like an Operator + is used for Addition of Two Numbers and + is also used for Joining two names The Polymorphism in java Introduces in the Form of Functions Overloading and in the Form of Constructor Overloading Dynamic Binding: Binding is used when we call the Code of the Procedure in Binding all the Code that is Linked with the single procedure is Called When a Call is Made to that Procedure Then the Compiler will found the Entire code of the Single Procedure if A Compiler will Fond all the Code of Single Procedure in Compile Time then it is Called as the Early Binding
  • 10. SUMMER TRAINING REPORT ON JAVA SE6 TECHNOLOGY 10 SHAMSHER AHMED | UE113087 10 Because Compiler Knows about the code at the time of Compilation but in the Late Binding Compiler will understand all the Code at Run Time or at the Time of the Execution. Message Communication is occurred when an object passes the Call to Method of Class for Execution We Know for executing any method from the class First we have to create the object of class when an object passes References to function of class then In Message Communication First of all we have to Create the Object of the Class the we make Communication between the Object and the Methods of the Class to the class. 1.4  Write Once, Run Anywhere as the core value proposition of the Java platform. Translated from business jargon, this means that the most important promise of Java technology is that you only have to write your application once--for the Java platform--and then you'll be able to run it anywhere. Anywhere, that is, that supports the Java platform. Fortunately, Java support is becoming ubiquitous. It is integrated, or being integrated, into practically all major operating systems. It is built into the popular web browsers, which places it on virtually every Internet-connected PC in the world. It is even being built into consumer electronic devices, such as television set-top boxes, PDAs, and cell phones.  Security The Java platform allows users to download untrusted code over a network and run it in a secure environment in which it cannot do any harm: it cannot infect the host system with a virus, cannot read or write files from the hard drive, and so forth. This capability alone makes the Java platform unique. The Java 2 Platform takes the security model a step further. It makes security levels and restrictions highly configurable and extends them beyond applets. As of Java 1.2, any Java code, whether it is an applet, a servlet, a JavaBeans component, or a complete Java application, can be run with restricted permissions that prevent it from doing harm to the host system. The security features of the Java language and platform have been subjected to intense scrutiny by security experts around the world. Security-related bugs, some of them potentially serious, have been found and promptly fixed. Because of the security promises Java makes, it is big news when a new security bug is found. Remember, however, that no other mainstream platform can make security guarantees nearly as strong as those Java makes. If Java's security is not yet perfect, it has been proven strong enough for practical day-to-day use and is certainly better than any of the alternatives.
  • 11. SUMMER TRAINING REPORT ON JAVA SE6 TECHNOLOGY 11 SHAMSHER AHMED | UE113087 11  Network-centric Programming The designers of the Java platform believed in the importance of networking and designed the Java platform to be network- centric. From a programmer's point of view, Java makes it unbelievably easy to work with resources across a network and to create network-based applications using client/server or multitier architectures. This means that Java programmers have a serious head start in the emerging network economy.  Dynamic, Extensible Programs Java is both dynamic and extensible. Java code is organized in modular object-oriented units called classes. Classes are stored in separate files and are loaded into the Java interpreter only when needed. This means that an application can decide as it is running what classes it needs and can load them when it needs them. It also means that a program can dynamically extend itself by loading the classes it needs to expand its functionality. The network-centric design of the Java platform means that a Java application can dynamically extend itself by loading new classes over a network. An application that takes advantage of these features ceases to be a monolithic block of code. Instead, it becomes an interacting collection of independent software components. Thus, Java enables a powerful new metaphor of application design and development  Internationalization The Java language and the Java platform were designed from the start with the rest of the world in mind. Java is the only commonly used programming language that has internationalization features at its very core, rather than tacked on as an afterthought. While most programming languages use 8-bit characters that represent only the alphabets of English and Western European languages, Java uses 16-bit Unicode characters that represent the phonetic alphabets and ideographic character sets of the entire world. Java's internationalization features are not restricted to just low-level character representation, however. The features permeate the Java platform, making it easier to write internationalized programs with Java than it is with any other environment.  Performance Java programs are compiled to a portable intermediate form known as byte codes, rather than to native machine-language instructions. The Java Virtual Machine runs a Java program by interpreting these portable byte-code instructions. This architecture means that Java programs are faster than programs or scripts written in purely interpreted languages, but they are typically slower than C and C++ programs compiled to native machine language. Keep in mind, however, that although Java programs are compiled to byte code, not all of the Java platform is implemented with interpreted byte codes. For efficiency, computationally intensive portions of the Java platform--such as the string- manipulation methods--are implemented using native machine code. Although early releases of Java suffered from performance problems, the speed of the Java VM has improved dramatically with each new release. The VM has been
  • 12. SUMMER TRAINING REPORT ON JAVA SE6 TECHNOLOGY 12 SHAMSHER AHMED | UE113087 12 highly tuned and optimized in many significant ways. Furthermore, many implementations include a just-in-time compiler, which converts Java byte codes to native machine instructions on the fly. Using sophisticated JIT compilers, Java programs can execute at speeds comparable to the speeds of native C and C++ applications. Java is a portable, interpreted language; Java programs run almost as fast as native, non-portable C and C++ programs. Performance used to be an issue that made some programmers avoid using Java. Now, with the improvements made in Java 1.2, performance issues should no longer keep anyone away. In fact, the winning combination of performance plus portability is a unique feature no other language can offer In every programming language we start with hello world program .Now let us see hello world program in Java. public class MyFirstJavaProgram { public static void main(String []args) { System.out.println("Hello World"); } }
  • 13. SUMMER TRAINING REPORT ON JAVA SE6 TECHNOLOGY 13 SHAMSHER AHMED | UE113087 13 Some important points while designing a Java program  Case Sensitivity Java is case sensitive which means identifier Hello and hello would have different meaning in Java. Class Names - For all class names the first letter should be in Upper Case. If several words are used to form a name of the class each inner words first letter should be in Upper Case. Example class MyFirstJavaClass  Method Names All method names should start with a Lower Case letter. If several words are used to form the name of the method, then each inner word's first letter should be in Upper Case. Example public void myMethodName ()  Program File Name - Name of the program file should exactly match the class name. When saving the file you should save it using the class name (Remember java is case sensitive) and append '.java' to the end of the name. (if the file name and the class name do not match your program will not compile). Example- Assume 'MyFirstJavaProgram' is the class name. Then the file should be saved as 'MyFirstJavaProgram.java'  public static void main(String args[]) - java program processing starts from the main() method which is a mandatory part of every java program.. All Java components require names. Names used for classes, variables and methods are called identifiers. In java there are several points to remember about identifiers. They are as follows:  All identifiers should begin with a letter (A to Z or a to z), currency character ($) or an underscore (_).  After the first character identifiers can have any combination of characters.  A key word cannot be used as an identifier.  Identifiers are case sensitive. Examples of legal identifiers: age, $salary, _value, __1_value Examples of illegal identifiers: 123abc, -salary These reserved words may not be used as constant or variable or any other identifier names.Java has about 49 keywords.
  • 14. SUMMER TRAINING REPORT ON JAVA SE6 TECHNOLOGY 14 SHAMSHER AHMED | UE113087 14 Java has very flexible three looping mechanisms. You can use one of the following three loops:  while Loop  do...while Loop  for Loop Syntax  while loop while(Boolean_expression){ //Statements }  for loop for(initialization; Boolean_expression; update){ / /Statements
  • 15. SUMMER TRAINING REPORT ON JAVA SE6 TECHNOLOGY 15 SHAMSHER AHMED | UE113087 15 } The flow of control in a for loop:  The initialization step is executed first, and only once. This step allows you to declare and initialize any loop control variables. You are not required to put a statement here, as long as a semicolon appears.  Next, the Boolean expression is evaluated. If it is true, the body of the loop is executed. If it is false, the body of the loop does not execute and flow of control jumps to the next statement past the for loop.  After the body of the for loop executes, the flow of control jumps back up to the update statement. This statement allows you to update any loop control variables. This statement can be left blank, as long as a semicolon appears after the Boolean expression.  The Boolean expression is now evaluated again. If it is true, the loop executes and the process repeats itself (body of loop, then update step, then Boolean expression). After the Boolean expression is false, the for loop terminates.  do while do{ //Statements }while(Boolean_expression); There are two types of decision making statements in Java. They are:  if statements  switch statements  The if Statement: An if statement consists of a Boolean expression followed by one or more statements.
  • 16. SUMMER TRAINING REPORT ON JAVA SE6 TECHNOLOGY 16 SHAMSHER AHMED | UE113087 16 Syntax: if(Boolean_expression){ //Statements will execute if the Boolean expression is true} If the Boolean expression evaluates to true then the block of code inside the if statement will beexecuted. If not the first set of code after the end of the if statement (after the closing curly brace) will be executed.  if...else Statement: An if statement can be followed by an optional else statement, which executes when the Boolean expression is false. Syntax: If (Boolean expression){ //Executes when the Boolean expression is true;} else { //Executes when the Boolean expression is false}  if...else if...else Statement: An if statement can be followed by an optional else if...else statement, which is very useful to test various conditions using single if...else if statement. When using if , else if , else statements there are few points to keep in mind. An if can have zero or one else's and it must come after any else if's. An if can have zero to many else if's and they must come before the else. Once an else if succeeds, none of the remaining else if's or else's will be tested.Syntax: if(Boolean_expression 1){ //Executes when the Boolean expression 1 is true }else if(Boolean_expression 2){ //Executes when the Boolean expression 2 is true }else if(Boolean_expression 3){ //Executes when the Boolean expression 3 is true }else { //Executes when the none of the above condition is true. } The switch Statement A switch statement allows a variable to be tested for equality against a list of values. Each value is called a case, and the variable being switched on is checked for each case.
  • 17. SUMMER TRAINING REPORT ON JAVA SE6 TECHNOLOGY 17 SHAMSHER AHMED | UE113087 17 Syntax: switch(expression){ case value : //Statements break; //optional case value : //Statements break; //optional //You can have any number of case statements. default : //Optional //Statement} The following rules apply to a switch statement:  The variable used in a switch statement can only be a byte, short, int, or char.  You can have any number of case statements within a switch. Each case is followed by the value to be compared to and a colon.  The value for a case must be the same data type as the variable in the switch and it must be a constant or a literal.  When the variable being switched on is equal to a case, the statements following that case will execute until a break statement is reached.  When a break statement is reached, the switch terminates, and the flow of control jumps to the next line following the switch statement.  Not every case needs to contain a break. If no break appears, the flow of control will fall through to subsequent cases until a break is reached. A switch statement can have an optional default case, which must appear at the end of the switch. The default case can be used for performing a task when none of the cases is true. No break is needed in the default case. Example: public class Test { public static void main(String args[]){ char grade = 'C'; switch(grade) { case 'A' : System.out.println("Excellent!"); break; case 'B' : case 'C' : System.out.println("Well done"); break; case 'D' :
  • 18. SUMMER TRAINING REPORT ON JAVA SE6 TECHNOLOGY 18 SHAMSHER AHMED | UE113087 18 System.out.println("You passed"); case 'F' : System.out.println("Better try again"); break; default : System.out.println("Invalid grade"); } System.out.println("Your grade is " + grade); } } Compile and run $ java Test Well done Your grade is a C Strings, which are widely used in Java programming, are a sequence of characters. In the Java programming language, strings are objects. Creating Strings The most direct way to create a string is to write: String greeting = "Hello world!"; Whenever it encounters a string literal in your code, the compiler creates a String object with its value in this case, "Hello world!'.As with any other object, you can create String objects by using the new keyword and a constructor. The String class has eleven constructors that allow you to provide the initial value of the string using different sources, such as an array of characters. public class StringDemo{ public static void main(String args[]){ char[] helloArray = { 'h', 'e', 'l', 'l', 'o', '.'}; String helloString = new String(helloArray); System.out.println( helloString ); }
  • 19. SUMMER TRAINING REPORT ON JAVA SE6 TECHNOLOGY 19 SHAMSHER AHMED | UE113087 19 Some Basic String class methods are S No String class Methods 1 char charAt(int index) Returns the character at the specified index. 2 int compareTo(Object o) Compares this String to another Object. 3 int compareTo(String anotherString) Compares two strings lexicographically. 4 int compareToIgnoreCase(String str) Compares two strings lexicographically, ignoring case differences. 5 String concat(String str) Concatenates the specified string to the end of this string. 6 boolean contentEquals(StringBuffer sb) Returns true if and only if this String represents the same sequence of characters as the specified StringBuffer. 7 static String copyValueOf(char[] data) Returns a String that represents the character sequence in the array specified. 8 static String copyValueOf(char[] data, int offset, int count) Returns a String that represents the character sequence in the array specified. 9 boolean endsWith(String suffix) Tests if this string ends with the specified suffix. 10 boolean equals(Object anObject) Compares this string to the specified object. 11 boolean equalsIgnoreCase(String anotherString) Compares this String to another String, ignoring case considerations. 12 byte getBytes() Encodes this String into a sequence of bytes using the platform's default charset, storing the result into a new byte array. 13 byte[] getBytes(String charsetName Encodes this String into a sequence of bytes using the named charset, storing the result into a new byte array. 14 void getChars(int srcBegin, int srcEnd, char[] dst, int dstBegin) Copies characters from this string into the destination character array. 15 int hashCode() Returns a hash code for this string. 16 int indexOf(int ch) Returns the index within this string of the first occurrence of the specified character. 17 int indexOf(int ch, int fromIndex) Returns the index within this string of the first occurrence of the specified character, starting the search at the specified index. 18 int indexOf(String str) Returns the index within this string of the first occurrence of the specified substring. 19 int indexOf(String str, int fromIndex) Returns the index within this string of the first occurrence of the specified substring, starting at the specified index. A Java method is a collection of statements that are grouped together to perform an operation. When you call the System.out.println method, for example, the system actually executes several statements in order to display a message on the console.
  • 20. SUMMER TRAINING REPORT ON JAVA SE6 TECHNOLOGY 20 SHAMSHER AHMED | UE113087 20 Main difference between methods and function is method always declared and defined inside the class while function may or may not declared inside the class. Creating a Method A method has the following syntax: modifier returnValueType methodName(list of parameters) { // Method body; } A method definition consists of a method header and a method body. Here are all the parts of a method:  The modifier, which is optional, tells the compiler how to call the method. This defines the access type of the method.  A method may return a value. The returnValueType is the data type of the value the method returns. Some methods perform the desired operations without returning a value. In this case, the returnValueType is the keyword void.  This is the actual name of the method. The method name and the parameter list together constitute the method signature.  A parameter is like a placeholder. When a method is invoked, you pass a value to the parameter. This value is referred to as actual parameter or argument. The parameter list refers to the type, order, and number of the parameters of a method. Parameters are optional; that is, a method may contain no parameters.  Method Body: The method body contains a collection of statements that define what the method does.
  • 21. SUMMER TRAINING REPORT ON JAVA SE6 TECHNOLOGY 21 SHAMSHER AHMED | UE113087 21 The java.io package contains nearly every class you might ever need to perform input and output (I/O) in Java. All these streams represent an input source and an output destination. The stream in the java.io package supports many data such as primitives, Object, localized characters, etc. A stream can be defined as a sequence of data. The InputStream is used to read data from a source and the OutputStream is used for writing data to a destination. Java does provide strong, flexible support for I/O as it relates to files and networks . Reading from Console Java input console is accomplished by reading from System.in. To obtain a character-based stream that is attached to the console, you wrap System.in in a BufferedReader object, to create a character stream. Here is most common syntax to obtain BufferedReader: BufferedReader br = new BufferedReader(new InputStreamReader(System.in)); Reading char and String from console Once BufferedReader is obtained, we can use read( ) method to reach a character or readLine( ) method to read a stri import java.io.*; public class BRReadLines { public static void main(String args[]) throws IOException { // Create a BufferedReader using System.in BufferedReader br = new BufferedReader(new InputStreamReader(System.in)); String str; char ch; System.out.println("Enter lines of text."); System.out.println("Enter 'end' to quit."); ch=(char)br.read(); do { str = br.readLine();
  • 22. SUMMER TRAINING REPORT ON JAVA SE6 TECHNOLOGY 22 SHAMSHER AHMED | UE113087 22 System.out.println(str); } while(!str.equals("end"));System.out.println(―Input Character =‖+ch); } } An exception is a problem that arises during the execution of a program. An exception can occur for many different reasons, including the following:  A user has entered invalid data.  A file that needs to be opened cannot be found.  A network connection has been lost in the middle of communications or the JVM has run out of memory. In java exception handling are three types  A checked exception is an exception that is typically a user error or a problem that cannot be foreseen by the programmer. For example, if a file is to be opened, but the file cannot be found, an exception occurs. These exceptions cannot simply be ignored at the time of compilation.  A runtime exception is an exception that occurs that probably could have been avoided by the programmer. As opposed to checked exceptions, runtime exceptions are ignored at the time of compilation.  These are not exceptions at all, but problems that arise beyond the control of the user or the programmer. Errors are typically ignored in your code because you can rarely do anything about an error. For example, if a stack overflow occurs, an error will arise. They are also ignored at the time of compilation. Exception Hierarchy All exception classes are subtypes of the java.lang.Exception class. The exception class is a subclass of the Throwable class. Other than the exception class there is another subclass called Error which is derived from the Throwable class. Errors are not normally trapped form the Java programs. These conditions normally happen in case of severe failures, which are not handled by the java programs. Errors are generated to indicate errors generated by the runtime environment. Example : JVM is out of Memory. Normally programs cannot recover from errors.
  • 23. SUMMER TRAINING REPORT ON JAVA SE6 TECHNOLOGY 23 SHAMSHER AHMED | UE113087 23 The Exception class has two main subclasses: IOException class and RuntimeException Class
  • 24. SUMMER TRAINING REPORT ON JAVA SE6 TECHNOLOGY 24 SHAMSHER AHMED | UE113087 24 Writing object-oriented programs involves creating classes, creating objects from those classes, and creating applications, which are stand-alone executable programs that use those objects. A class is a template, blueprint, or contract that defines what an object‘s data fields and methods will be. An object is an instance of a class. So we can create many instances of a class. A Java class uses variables to define data fields and methods to define actions. Additionally, a class provides methods of a special type, known as constructors, which are invoked to create a new object. A constructor can perform any action, but constructors are designed to perform initializing actions, such as initializing the data fields of objects Objects are key to understanding object-oriented technology. Look around right now and you'll find many examples of real-world objects: your dog, your desk, your television set, your bicycle. Real-world objects share two characteristics: They all have state and behavior. Dogs have state (name, color, breed, hungry) and behavior (barking, fetching, wagging tail). Bicycles also have state (current gear, current pedal cadence, current speed) and behavior (changing gear, changing pedal cadence, applying brakes). Identifying the state and behavior for real-world objects is a great way to begin thinking in terms of object-oriented programming. Take a minute right now to observe the real-world objects that are in your immediate area. For each object that you see, ask yourself two questions: "What possible states can this object be in?" and "What possible behavior can this object perform?". Make sure to write down your observations. As you do, you'll notice that real-world objects vary in complexity; your desktop lamp may have only two possible states (on and off) and two possible behaviors (turn on, turn off), but your desktop radio might have additional states (on, off, current volume, current station) and behavior (turn on, turn off, increase volume, decrease volume, seek, scan, and tune). You may also notice that some objects, in turn, will also contain other objects. These real-world observations all translate into the world of object-oriented programming Software Object
  • 25. SUMMER TRAINING REPORT ON JAVA SE6 TECHNOLOGY 25 SHAMSHER AHMED | UE113087 25 Software objects are conceptually similar to real-world objects: they too consist of state and related behavior. An object stores its state in fields (variables in some programming languages) and exposes its behavior through methods (functions in some programming languages). Methods operate on an object's internal state and serve as the primary mechanism for object-to-object communication. Hiding internal state and requiring all interaction to be performed through an object's methods is known as data encapsulation — a fundamental principle of object-oriented programming. In the real world, you'll often find many individual objects all of the same kind. There may be thousands of other bicycles in existence, all of the same make and model. Each bicycle was built from the same set of blueprints and therefore contains the same components. In object-oriented terms, we say that your bicycle is an instance of the class of objects known as bicycles. A class is the blueprint from which individual objects are created. The following Bicycle class is one possible implementation of a bicycle: class Bicycle { int cadence = 0; int speed = 0; int gear = 1; void changeCadence(int newValue) { cadence = newValue; } void changeGear(int newValue) { gear = newValue; } void speedUp(int increment) { speed = speed + increment; }
  • 26. SUMMER TRAINING REPORT ON JAVA SE6 TECHNOLOGY 26 SHAMSHER AHMED | UE113087 26 void applyBrakes(int decrement) { speed = speed - decrement; } void printStates() { System.out.println("cadence:" +cadence + " speed:" + speed + " gear:" + gear); } } The fields cadence, speed, and gear represent the object's state, and the methods (changeCadence, changeGear, speedUp etc.) define its interaction with the outside world. Object-oriented programming allows classes to inherit commonly used state and behavior from other classes. In this example, Bicycle now becomes the superclass of MountainBike, RoadBike, and TandemBike. In the Java programming language, each class is allowed to have one direct superclass, and each superclass has the potential for an unlimited A hierarchy of Bicycle class In the Java programming language, an interface is a reference type, similar to a class, that can contain only constants, method signatures, and nested types. There are no method bodies.
  • 27. SUMMER TRAINING REPORT ON JAVA SE6 TECHNOLOGY 27 SHAMSHER AHMED | UE113087 27 Interfaces cannot be instantiated—they can only be implemented by classes or extended by other interface. Interfaces have another very important role in the Java programming language. Interfaces are not part of the class hierarchy, although they work in combination with classes. The Java programming language does not permit multiple inheritance (inheritance is discussed later in this lesson), but interfaces provide an alternative. In Java, a class can inherit from only one class but it can implement more than one interface. Therefore, objects can have multiple types: the type of their own class and the types of all the interfaces that they implement. This means that if a variable is declared to be the type of an interface, its value can reference any object that is instantiated from any class that implements the interfaces. Encapsulation is a mechanism where the data and the code that acts on the data will bind together. For example ,if we take a class we write the variable and methods inside the class .Thus class is binding them together .So class is an example of encapsulation. The variable and methods of a class are called members of the class .Generally the variable in the class are decided by using a keyword ‗private‘ .This means the variables are not directly available to any other class .The class or method which are declared ‗public‘ can be used and directly called from any where . class Employee{ private int id=10; String name=‖Shamsher‖ String Roll=‖UE113087‖ Void display(){ System.out.println(―Id of Student ‖+id); } } class DEMO extends Employee {
  • 28. SUMMER TRAINING REPORT ON JAVA SE6 TECHNOLOGY 28 SHAMSHER AHMED | UE113087 28 void display(){ Employee ob1=new Employee(); System.out.println(―Roll no of Student‖+ob1.Roll); System.out.println(―Name of Student‖+ob1.name); ob1.display(); } The polymorphism represents the ability to assume several forms. In Java we can use the single variable to refer to objects of different types and thus using that variable we can all the methods of the different objects .Thus a method call can perform different tasks depending upon the type of objects. Polymorphism provides flexibility in writing programs in such way that the programmer uses same method call to perform different operation depending upon the requirements. Class one{ int a; int b; void one(int in){ a=in; b=9; } void one(int in,int ou){ a=in; b=ou; } }
  • 29. SUMMER TRAINING REPORT ON JAVA SE6 TECHNOLOGY 29 SHAMSHER AHMED | UE113087 29 Abstraction refer to act of representing only those information which are necessary while hiding details of the program.The main advantage of Abstraction is that every user will get view of data according to his needs while hiding the details of the project ,which might confused him when he see the whole data as whole Mostly all object oriented language support Data Abstraction Like Java ,C++. support Data Abstraction Like Java ,C++.
  • 30. SUMMER TRAINING REPORT ON JAVA SE6 TECHNOLOGY 30 SHAMSHER AHMED | UE113087 30 The JDBC API is a Java API that can access any kind of tabular data, especially data stored in a Relational Database. JDBC helps you to write Java applications that manage these three programming activities  Connect to a data source, like a database  Send queries and update statements to the database  Retrieve and process the results received from the database in answer to your query JDBC includes four components:  The JDBC API — The JDBC™ API provides programmatic access to relational data from the Java™ programming language. Using the JDBC API, applications can execute SQL statements, retrieve results, and propagate changes back to an underlying data source. The JDBC API can also interact with multiple data sources in a distributed, heterogeneous environment. The JDBC API is part of the Java platform, which includes the Java™ Standard Edition (Java™ SE ) and the Java™ Enterprise Edition (Java™ EE). The JDBC 4.0 API is divided into two packages: java.sql and javax.sql. Both packages are included in the Java SE and Java EE platforms.  JDBC Driver Manager — The JDBC DriverManager class defines objects which can connect Java applications to a JDBC driver. DriverManager has traditionally been the backbone of the JDBC architecture. It is quite small and simple . The Standard Extension packages javax.naming and javax.sql let you use a DataSource object registered with a Java Naming and Directory Interface™ (JNDI) naming service to establish a connection with a data source. You can use either connecting mechanism, but using a DataSource object is recommended whenever possible.  JDBC Test Suite — The JDBC driver test suite helps you to determine that JDBC drivers will run your program. These tests are not comprehensive or exhaustive, but they do exercise many of the important features in the JDBC API.  JDBC-ODBC Bridge — The Java Software bridge provides JDBC access via ODBC drivers. Note that you need to load ODBC binary code onto each client machine that uses this driver. As a result, the ODBC driver is most appropriate on a corporate network where client installations are not a major problem, or for application server code written in Java in a three-tier architecture
  • 31. SUMMER TRAINING REPORT ON JAVA SE6 TECHNOLOGY 31 SHAMSHER AHMED | UE113087 31 5.1 Mp3 music player Music player is mp3 player which is purely built in Java .And this project relies heavily on Java Sound API . 5.1.1 Software Development life cycle The software development life cycle (SDLC) is a conceptual model used in project management that describes the stages involved in an information system development project, from an initial feasibility study through maintenance of the completed application/product. Understand the relationship between development, test activities and work products in the Development life cycle and give examples based on project and product characteristics and context. Recognize the fact that software development models must be adapted to the context of project and product characteristics.
  • 32. SUMMER TRAINING REPORT ON JAVA SE6 TECHNOLOGY 32 SHAMSHER AHMED | UE113087 32 Recall reasons for different levels of testing and characteristics of good testing in any life cycle model. 5.1.2 Waterfall models The waterfall model is a popular version of the systems development life cycle model for software engineering. Often considered the classic approach to the systems development life cycle, the waterfall model describes a development method that is linear and sequential. Waterfall development has distinct goals for each phase of development. Imagine a waterfall on the cliff of a steep mountain. Once the water has flowed over the edge of the cliff and has begun its journey down the side of the mountain, it cannot turn back. It is the same with waterfall development. Once a phase of development is completed, the development proceeds to the next phase and there is no turning back. History of Waterfall Model In 1970 Royce proposed what is now popularly referred to as the waterfall model as an initial concept, a model which he argued was flawed (Royce 1970). His paper then explored how the initial model could be developed into an iterative model, with feedback from each phase influencing previous phases, similar to many methods used widely and highly regarded by many today.
  • 33. SUMMER TRAINING REPORT ON JAVA SE6 TECHNOLOGY 33 SHAMSHER AHMED | UE113087 33 Despite Royce's intentions for the waterfall model to be modified into an iterative model, use of the "waterfall model" as a purely sequential process is still popular, and, for some, the phrase "waterfall model" has since come to refer to any approach to software creation which is seen as inflexible and non-iterative. When to use the waterfall model:  Requirements are very well known, clear and fixed.  Product definition is stable.  Technology is understood.  There are no ambiguous requirements Advantages of Waterfall Model  Simple and easy to understand and use.  Easy to manage due to the rigidity of the model – each phase has specific deliverables and a review process.  Phases are processed and completed one at a time.  Works well for smaller projects where requirements are very well understood. Disadvantages of Waterfall Model  Once an application is in the testing stage, it is very difficult to go back and change something that was not well-thought out in the concept stage.  No working software is produced until late during the life cycle.  High amounts of risk and uncertainty.
  • 34. SUMMER TRAINING REPORT ON JAVA SE6 TECHNOLOGY 34 SHAMSHER AHMED | UE113087 34  Not a good model for complex and object-oriented projects.  Poor model for long and ongoing projects.  Not suitable for the projects where requirements are at a moderate to high risk of changing. 5.1.3 Requirement of this Project Hardware Requirement  Pentium powered Processor- speed 2.1 Ghz  RAM - 1GB  Hard Disk - 20 GB  Key Board -  Standard Windows Keyboard Mouse  Monitor - LED Software Requirement  Java Development Kit version 1.6  Neatbeans version7.01  Operating System type Windows 7/Debian 7 Library used In this Project  JLayer1.0.1  Java Sound Api JLayer 1.0.1 JLayer is a library that decodes/plays/converts MPEG 1/2/2.5 Layer 1/2/3 (i.e. MP3) in real time for the JAVA(tm) platform. This is a non-commercial project and is licensed under LGPL. To play mp3 in through JLayer JLayer, Tritonus and MP3SPI librairies are available in your CLASSPATH. It means that you have jl1.0.1.jar, tritonus_share.jar, mp3spi1.9.5.jar in your CLASSPATH. List of Classes Available in JLayer  javazoom/jl/converter/Converter  javazoom/jl/converter/RiffFile  javazoom/jl/converter/WaveFile  javazoom/jl/converter/WaveFileObuffer  javazoom/jl/converter/jlc  javazoom/jl/decoder/BitReserve  javazoom/jl/decoder/Bitstream
  • 35. SUMMER TRAINING REPORT ON JAVA SE6 TECHNOLOGY 35 SHAMSHER AHMED | UE113087 35  javazoom/jl/decoder/BitstreamErrors  javazoom/jl/decoder/BitstreamException  javazoom/jl/decoder/Control  javazoom/jl/decoder/Crc16  javazoom/jl/decoder/Decoder  javazoom/jl/decoder/DecoderErrors  javazoom/jl/decoder/DecoderException  javazoom/jl/decoder/Equalizer  javazoom/jl/decoder/FrameDecoder  javazoom/jl/decoder/Header  javazoom/jl/decoder/InputStreamSource  javazoom/jl/decoder/JavaLayerError  javazoom/jl/decoder/JavaLayerErrors  javazoom/jl/decoder/JavaLayerException  javazoom/jl/decoder/JavaLayerHook  javazoom/jl/decoder/JavaLayerUtils  javazoom/jl/decoder/LayerIDecoder  javazoom/jl/decoder/LayerIIDecoder  javazoom/jl/decoder/LayerIIIDecoder  javazoom/jl/decoder/Manager  javazoom/jl/decoder/Obuffer  javazoom/jl/decoder/OutputChannels  javazoom/jl/decoder/SampleBuffer  javazoom/jl/decoder/Source  javazoom/jl/decoder/SynthesisFilter  javazoom/jl/decoder/huffcodetab  javazoom/jl/player/AudioDevice  javazoom/jl/player/AudioDeviceBase  javazoom/jl/player/AudioDeviceFactory  javazoom/jl/player/FactoryRegistry  javazoom/jl/player/JavaSoundAudioDevice  javazoom/jl/player/JavaSoundAudioDeviceFactory  javazoom/jl/player/NullAudioDevice  javazoom/jl/player/Player  javazoom/jl/player/PlayerApplet  javazoom/jl/player/advanced/AdvancedPlayer  javazoom/jl/player/advanced/PlaybackEvent  javazoom/jl/player/advanced/PlaybackListener  javazoom/jl/player/advanced/jlap  javazoom/jl/player/jlp
  • 36. SUMMER TRAINING REPORT ON JAVA SE6 TECHNOLOGY 36 SHAMSHER AHMED | UE113087 36 5.1.4 Design Of The Project This music player project is divided into  Organisation  Player  Playlist  Utility  Interface 5.1.5 Testing Software testing is an investigation conducted to provide stakeholders with information about the quality of the product or service under test.Software testing can also provide an objective, independent view of the software to allow the business to appreciate and understand the risks of software implementation. Test techniques include, but are not limited to the process of executing a program or application with the intent of finding software bugs (errors or other defects). Software testing can be stated as the process of validating and verifying that a computer program/application/product:  meets the requirements that guided its design and development,  works as expected,  can be implemented with the same characteristics,  and satisfies the needs of stakeholders.
  • 37. SUMMER TRAINING REPORT ON JAVA SE6 TECHNOLOGY 37 SHAMSHER AHMED | UE113087 37 Testing methods  Static vs. dynamic testing There are many approaches to software testing. Reviews, walkthroughs, or inspections are referred to as static testing, whereas actually executing programmed code with a given set of test cases is referred to as dynamic testing. Static testing can be omitted, and in practice often is. Dynamic testing takes place when the program itself is used. Dynamic testing may begin before the program is 100% complete in order to test particular sections of code and are applied to discrete functions or modules. Typical techniques for this are either using stubs/drivers or execution from a debugger environment. Static testing involves verification whereas dynamic testing involves validation. Together they help improve software quality.  The box approach Software testing methods are traditionally divided into white- and black-box testing. These two approaches are used to describe the point of view that a test engineer takes when designing test cases. White Box White-box testing (also known as clear box testing, glass box testing, transparent box testing and structural testing) tests internal structures or workings of a program, as opposed to the functionality exposed to the end-user. In white-box testing an internal perspective of the system, as well as programming skills, are used to design test cases. The tester chooses inputs to exercise paths through the code and determine the appropriate outputs. This is analogous to testing nodes in a circuit, e.g. in-circuit testing (ICT). While white-box testing can be applied at the unit, integration and system levels of the software testing process, it is usually done at the unit level. It can test paths within a unit, paths between units during integration, and between subsystems during a system–level test. Though this method of test design can uncover many errors or problems, it might not detect unimplemented parts of the specification or missing requirements. Techniques used in white-box testing include:  API testing (application programming interface) – testing of the application using public and private APIs  Code coverage – creating tests to satisfy some criteria of code coverage (e.g., the test designer can create tests to cause all statements in the program to be executed at least once)  Fault injection methods – intentionally introducing faults to gauge the efficacy of testing strategies  Mutation testing methods  Static testing methods  Code coverage tools can evaluate the completeness of a test suite that was created with any method, including black-box testing. This allows the software team to examine parts of a system that are rarely tested and ensures that the most
  • 38. SUMMER TRAINING REPORT ON JAVA SE6 TECHNOLOGY 38 SHAMSHER AHMED | UE113087 38 important function points have been tested.Code coverage as a software metric can be reported as a percentage for: Black Box Black-box testing treats the software as a "black box", examining functionality without any knowledge of internal implementation. The tester is only aware of what the software is supposed to do, not how it does it. Black-box testing methods include: equivalence partitioning, boundary value analysis, all-pairs testing, state transition tables, decision table testing, fuzz testing, model-based testing, use case testing, exploratory testing and specification-based testing. Specification-based testing aims to test the functionality of software according to the applicable requirements.This level of testing usually requires thorough test cases to be provided to the tester, who then can simply verify that for a given input, the output value (or behavior), either "is" or "is not" the same as the expected value specified in the test case. Test cases are built around specifications and requirements, i.e., what the application is supposed to do. It uses external descriptions of the software, including specifications, requirements, and designs to derive test cases. These tests can be functional or non-functional, though usually functional. Specification-based testing may be necessary to assure correct functionality, but it is insufficient to guard against complex or high-risk situations. One advantage of the black box technique is that no programming knowledge is required. Whatever biases the programmers may have had, the tester likely has a different set and may emphasize different areas of functionality. On the other hand, black-box testing has been said to be "like a walk in a dark labyrinth without a flashlight."Because they do not examine the source code, there are situations when a tester writes many test cases to check something that could have been tested by only one test case, or leaves some parts of the program untested. This method of test can be applied to all levels of software testing: unit, integration, system and acceptance. It typically comprises most if not all testing at higher levels, but can also dominate unit testing as well. The aim of visual testing is to provide developers with the ability to examine what was happening at the point of software failure by presenting the data in such a way that the developer can easily find the information he or she requires, and the information is expressed clearly. At the core of visual testing is the idea that showing someone a problem (or a test failure), rather than just describing it, greatly increases clarity and understanding. Visual testing therefore requires the recording of the entire test process – capturing everything that occurs on the test system in video format. Output videos
  • 39. SUMMER TRAINING REPORT ON JAVA SE6 TECHNOLOGY 39 SHAMSHER AHMED | UE113087 39 are supplemented by real-time tester input via picture-in-a-picture webcam and audio commentary from microphones. Visual testing provides a number of advantages. The quality of communication is increased dramatically because testers can show the problem (and the events leading up to it) to the developer as opposed to just describing it and the need to replicate test failures will cease to exist in many cases. The developer will have all the evidence he or she requires of a test failure and can instead focus on the cause of the fault and how it should be fixed. Visual testing is particularly well-suited for environments that deploy agile methods in their development of software, since agile methods require greater communication between testers and developers and collaboration within small teams. Ad hoc testing and exploratory testing are important methodologies for checking software integrity, because they require less preparation time to implement, while the important bugs can be found quickly. In ad hoc testing, where testing takes place in an improvised, impromptu way, the ability of a test tool to visually record everything that occurs on a system becomes very important. Visual testing is gathering recognition in customer acceptance and usability testing, because the test can be used by many individuals involved in the development process. For the customer, it becomes easy to provide detailed bug reports and feedback, and for program users, visual testing can record user actions on screen, as well as their voice and image, to provide a complete picture at the time of software failure for the developer. Testing levels  Unit testing, also known as component testing, refers to tests that verify the functionality of a specific section of code, usually at the function level. In an object-oriented environment, this is usually at the class level, and the minimal unit tests include the constructors and destructors. These types of tests are usually written by developers as they work on code (white-box style), to ensure that the specific function is working as expected. One function might have multiple tests, to catch corner cases or other branches in the code. Unit testing alone cannot verify the functionality of a piece of software, but rather is used to assure that the building blocks the software uses work independently of each other. Unit testing is a software development process that involves synchronized application of a broad spectrum of defect prevention and detection strategies in order to reduce software development risks, time, and costs. It is performed by the software developer or engineer during the construction phase of the software development lifecycle. Rather than replace traditional QA focuses, it augments it. Unit testing aims to eliminate construction errors
  • 40. SUMMER TRAINING REPORT ON JAVA SE6 TECHNOLOGY 40 SHAMSHER AHMED | UE113087 40 before code is promoted to QA; this strategy is intended to increase the quality of the resulting software as well as the efficiency of the overall development and QA process.  Integration testing is any type of software testing that seeks to verify the interfaces between components against a software design. Software components may be integrated in an iterative way or all together ("big bang"). Normally the former is considered a better practice since it allows interface issues to be located more quickly and fixed.Integration testing works to expose defects in the interfaces and interaction between integrated components (modules). Progressively larger groups of tested software components corresponding to elements of the architectural design are integrated and tested until the software works as a system  System testing tests a completely integrated system to verify that it meets its requirements. In addition, the software testing should ensure that the program, as well as working as expected, does not also destroy or partially corrupt its operating environment or cause other processes within that environment to become inoperative (this includes not corrupting shared memory, not consuming or locking up excessive resources and leaving any parallel processes unharmed by its presence  Acceptance testing can mean one of two things:  A smoke test is used as an acceptance test prior to introducing a new build to the main testing process, i.e. before integration or regression.  Acceptance testing performed by the customer, often in their lab environment on their own hardware, is known as user acceptance testing (UAT). Acceptance testing may be performed as part of the hand-off process between any two phases of development Alpha testing is simulated or actual operational testing by potential users/customers or an independent test team at the developers' site. Alpha testing is often employed for off-the-shelf software as a form of internal acceptance testing, before the software goes to beta testing Beta testing comes after alpha testing and can be considered a form of external user acceptance testing. Versions of the software, known as beta versions, are released to a limited audience outside of the programming team. The software is released to groups of people so that further testing can ensure the product has few faults or bugs. Sometimes, beta versions are made available to the open public to increase the feedback field to a maximal number of future users
  • 41. SUMMER TRAINING REPORT ON JAVA SE6 TECHNOLOGY 41 SHAMSHER AHMED | UE113087 41 5.1.4 Memory Analysis Snapshots of Memory Usage In Java
  • 42. SUMMER TRAINING REPORT ON JAVA SE6 TECHNOLOGY 42 SHAMSHER AHMED | UE113087 42 5.2 Conclusion