Thursday, 22 August 2013

Java OOPs Concept

Lesson: Object-Oriented Programming Concepts

If you've never used an object-oriented programming language before, you'll need to learn a few basic concepts before you can begin writing any code. This lesson will introduce you to objects, classes, inheritance, interfaces, and packages. Each discussion focuses on how these concepts relate to the real world, while simultaneously providing an introduction to the syntax of the Java programming language.

What Is an Object?

An object is a software bundle of related state and behavior. Software objects are often used to model the real-world objects that you find in everyday life. This lesson explains how state and behavior are represented within an object, introduces the concept of data encapsulation, and explains the benefits of designing your software in this manner.

What Is a Class?

A class is a blueprint or prototype from which objects are created. This section defines a class that models the state and behavior of a real-world object. It intentionally focuses on the basics, showing how even a simple class can cleanly model state and behavior.

What Is Inheritance?

Inheritance provides a powerful and natural mechanism for organizing and structuring your software. This section explains how classes inherit state and behavior from their superclasses, and explains how to derive one class from another using the simple syntax provided by the Java programming language.

What Is an Interface?

An interface is a contract between a class and the outside world. When a class implements an interface, it promises to provide the behavior published by that interface. This section defines a simple interface and explains the necessary changes for any class that implements it.

What Is a Package?

A package is a namespace for organizing classes and interfaces in a logical manner. Placing your code into packages makes large software projects easier to manage. This section explains why this is useful, and introduces you to the Application Programming Interface (API) provided by the Java platform.

Questions and Exercises: Object-Oriented Programming Concepts

Use the questions and exercises presented in this section to test your understanding of objects, classes, inheritance, interfaces, and packages.

Tuesday, 20 August 2013

10 Best Java Web Development Framework

10 Best Java Web Development Framework

There are a majority of enterprises running Java applications and working on Java web development framework. What remains to be seen is that a number of companies are tied to the conventional web development framework and haven’t actually started to anticipate what could be the best Java web development framework. Even the Java-one might hold no unified voice for what web framework is best. There are several easy to use Java web frameworks that are out now a days, and they are too many. Essentially choosing the best web development framework has become more intricate, specifically due to three reasons. On a broader perspective, the web technology landscape has undergone a sea change; far more choice of technology; and changing requirements for modern web applications. After an extensive research we assorted the 10 best Java web development framework that we would like to share with you.

1. Struts 2

Apache Struts 2 is an enterprise-ready web framework for Java application. It has been designed to streamline the entire development cycle starting from building to deploying. Struts 2 is a combined effort of WebWork and Struts communities. Unlike conventional web applications, it can create dynamic responses. Struts 2 comes with an improved design with clean code for HTTP-independent framework interfaces. Added interactivity and flexibility with AJAX tags gives the look and feel just like standard Struts tags. It doesn’t use Action forms, instead Struts 2 uses JavaBean to capture form input or put properties directly on an Action class. POJO Actions enables class to used as an action class with optional interface. Plugin APIs for the framework include config browser, JasperReports, JavaServer Faces, Pell Multipart, Plexus, sitegraph, sitemesh, tiles and Struts 1. The framework essentially requires Servlet API 2.4, JSP API 2.0 and Java 5.
Struts 2 could be a great option for small teams looking to learn about the open source tools they use. It’s not for armchair programmers looking for drag and drop development.


2. JSF

JavaServer Faces (JSF) is a java web application framework established the standard for development of server-side user interfaces for Java EE application. The JSF APIs are designed to leverage tools that would make we application development increasingly easier. It uses a component based approach. JSF uses JavaServer Pages JSP as its display technology, but it can also support other technologies such as XUL and Facelets . The UI is saved on clients request for new page and restored when the response is returned.
JSF has a set of API for representing user interface components and manages their state, converting values, input validation and event handling, defining page navigation and support for accessibility and internationalization. It has two JavaServer Pages (JSP) custom tag libraries for expressing a JavaServer Faces interface within a JSP page. Some of its key features include server-side event model, state management, JavaBeans with dependency injection and Unified Expression Language for both JSP 2.0 and JSF 1.2. JSF 2.0 offers improved support for Ajax by allowing UI logic to run partly on the client and not on the server.
For the latest, in the public draft for JEE6, Facelets would be adopted as the official view technology for JSF 2.0. This would resolve the life-cycle conflicts with JSP that forced developers to go for workarounds.
    Pros
  • Java EE standard with lots of demand and jobs
  • Initially was fast and easy to develop
  • Loads of component libraries
    Cons
  • Tag soup for JSPs
  • Lacks unified source for implementation
  • Doesn’t support REST or Security well

3. Spring MVC

It is a layered Java/J2EE framework integrating a number of different technologies and is applicable to wide range of projects. Spring is based on code published in Expert One-on-One J2EE Design and Development. Spring clearly separates business, navigation and presentation logic. It is a proven web mechanism constructed with a clean web tier. Spring MVC allows users to use any object as a command or form object – there is no need to implement a framework-specific interface or base class. Spring’s features a highly flexible data binding. MVC Model and VIew is based on the map interface that is highly configurable, either via bean names, via a properties file, or via your own ViewResolver implementation. Spring supports controller as an optional command or form object. It has an extremely flexible view resolution that can even write a view directly to the response.
It should be considered a strategic base platform for web application development.


4. Wicket

Apache Wicket is a lightweight component based web application framework for the Java programming language. Wicket is patterned after stateful GUI frameworks. It features trees of components that use listener delegates to react to HTTP requests against links and forms. With XHTML for templates it separate presentation and business logic and allows templates to be edited with conventional WYSIWYG design tools. Within the framework each component is backed by its own model that represents the state of the components. Wicket might be the best framework for making use of your developers resources.


5. Stripes

The web framework offers a lot of complex data interactions. It offers powerful type conversion, binding and validation. Stripes has been designed to manage large, complex forms and maps them directly to objects etc. Stripes requires zero external configuration beyond the registration of one servlet and one filter. Most importantly, Stripes provides simple and effective solution to common problems such as indexed properties, multi-event forms, localization and use of domain objects in the web tier. It is a compact web development framework with just few dependencies.


6. Tapestry

It is an object oriented powerful, open-source, all-Java framework for creating leading edge web applications in Java. The framework allows implementation of applications according to the model-view-controller design pattern. Tapestry offers an innovative web application development concept in terms of objects, methods and properties instead of URLs and query parameters. It adopts a modular approach to web development by combining user interface components (objects) on the web page and their corresponding Java classes.
It could be a rescue for those looking to avoid scripting environments such as JavaServer Pages or Velocity. It provides a complete framework for creating extremely dynamic applications with minimal amounts of coding. The web development framework focuses on simplicity, ease of use, and relieves programmers from creating enormous block codes.
For the latest Tapestry offers a new approach with an entirely new code base, centered on Plain Old Java Objects, annotations and naming conventions, and runtime bytecode enhancement.


7 . RIFE

This is a unique framework for web development and design with tools and APIs to implement commonly used web features. It has been designed for separating tasks during a development cycle, ensuring that each developer or designer focuses on his own tasks. If needed the any work can be effortlessly integrated with the work of the rest of the team. RIFE’s has a number of independently usable toolkits, which can be integrated to boost productivity. All the declaration and definitions in RIFE is handled in one place in the code. This makes it easy for the developers to reduce code replication, enforce consistency, and ease the maintenance. This results in a loosely coupled and very robust system.
It combines the best of request based and component approach to offer consistent component based object model. RIFE’s design provides the best of request-based and component-based approaches and blends them together in a consistent component object model. The web engine provides a solution that values maintainability without compromising on productivity. Through a centralized site structure, an application can be split up into easily reusable binary modules that can be seamlessly integrated into other projects. There is a wide scope for incremental improvements with little or no risk of unwanted anomalies in the system.


8. Seam

It’s a powerful open source web application framework developed by JBoss. Seam offers a perfect platform for building rich Internet applications in Java. It is a unified full-stack solution that integrates technologies such as Ajax, JavaServer Faces (JSF), Java Persistence (JPA), Enterprise Java Beans (EJB 3.0) and Business Process Management (BPM) into tooling. Seam also expands the concept of contexts. All the Seam component are enclosed within a context. The default Seam context is conversation which can span multiple pages and usually spans the whole business flow, from start to finish. All the actions in a session context is captured until the user logs out or closes the browser. WYSIWYG development in Seam is facilitated through the use of JBoss Tools.
Seam overcomes design issues by eliminating both eliminate complexity at both architecture and API levels. It enables developers to assemble complex web applications using simple annotated Java classes, a rich set of UI components, and XML in parts. Above all, it offers outstanding support for conversations and declarative state management that can introduce a more sophisticated user experience. At the same time it eliminates the common bugs found in traditional web applications.
Exceptionally, Seam features a PDF document creator, e-mailing, graph creation and creation of Microsoft Excel worksheets.


9. Google Web Toolkit (GWT)

GWT is a Java software development framework that allows web developers to build and maintain complex Javascript front-end applications in Java. The web development framework makes it easy for developers to write AJAX applications like Google Maps and Gmail. Other than a few native libraries, everything is Java source that can be built on any supported platform with the included GWT Ant build files. GWT focuses on reusable, efficient solutions for asynchronous remote procedure calls, Internationalization, history management, bookmarking and cross-browser portability. It allows developers to develop and debug AJAX applications in the Java language with any Java development tools of their choice. However, due to lack of modularity in JavaScript, sharing, testing, and reusing AJAX components becomes a hassle.


10 . OpenXava

It is a web development framework for creating Ajax Enterprise applications with Java. OpenXava has been designed by Java developers looking for a productive Java Enterprise applications. In OpenXava developers have to provide only the JPA classes to obtain a full featured application ready for production. It requires no code generation. It allows rapid and easy generation of CRUD modules and report generation. It also allows the flexibility to develop complex real life business applications as customer relationship, invoicing, accounting packages, warehouse management, etc. It The web framework offers full Ajax support and can be used on application server (Tomcat, JBoss, WebSphere, etc).
It is a faster framework than Ruby On Rails, Spring MVC, or any other MVC framework.

Sunday, 18 August 2013

File Structure
  • Each source file can contain only one public class or interface. Two public classes in the same file are not allowed.
  • A source file can contain any number of non-public classes. Each class will be compiled into a separate .class file.
  • The source file name must be the name of the public class or the interface.
  • The source file structure should be as follows :
    Package declaration
    Import statement
    Class or interface definition
  • A package statement must appear as the first statement of a source file followed by import statements and class or interface definition.
  • Packages are a collection of related classes and interfaces.
  • If a class or interface is without a package name, then those are put into a default no-name package.
  • java.lang package is imported by default, we don't have to import it explicitly.
main method
  • All java application programs must have a main() method.
  • main method() is the application's entry point, which would be called by the JVM.
  • main method()'s return type is void, access specifier is public, argument is String array and it is static.
  • order of public and static does not matter but void should always come before main().
  • main() can be declared as final.
  • Applets need not have a main() method. It's not a problem even if they have a main method.
Primitives
  • There are 8 primitive data types in java. They are not objects.
  • boolean is 8 bits in size and stores true or false. It's default value is false.
  • byte is 8 bit signed integer and stores values in the range of -27 to 27 -1.It's default value is 0.
  • char is 16 bit unsigned integer and stores values in the range of 0 to 216-1 ie between '\u0000' to '\uffff'. It's default value is '\u0000'.
  • short is 16 bit signed integer and stores values in the range of -215 to 215 -1. It's default value is 0.
  • int is 32 bit signed integer and stores values in the range of -231 to 231 -1. It's default value is 0.
  • long is 64 bit signed integer and stores values in the range of -263 to 263 -1. It's default value is 0l.
  • float stores 32 bit floating point values. It's default value is 0.0f.
  • double stores 64 bit floating point values. It's default value is 0.0d.
Variables
  • Variables declared at class level are called as field or instance variables.
  • Variables declared inside a method are called as local variables or automatic variables.
  • Field variables are automatically intialized to their default values.
  • Local variables are not initialized automatically. They have to be initialzed before using them.
  • Arrays, whether local or class-level, are always initialized.
Operators
  • The modoulo (%) operator gives the remainder as result, when one operand is divided by another.
  • When a int is divided by zero, java.lang.ArithmeticException will be thrown.
  • == and != operators are used to check, if the objects are of the same instance.
  • equals() method of the object class is used to check, if two objects have the same value.
  • instanceof operator is used to determine, if an object reference on the left hand side is an instance of the class or an interface on the right operand.
Arrays
  • Arrays are objects.
  • The following are legal declarations of an array.
    int i[];
    int[] i;
    int i [][];
    int[] x[];
  • The following are the two ways to create an array.
    int i[] = {1,2,3,4,5};
    String str[] = new String[4];
  • Array indexes start at 0. str.length for the above statement will result as 5. length is a property of array and is not a method.
  • primitives are passed by value and objects are passed by reference. Since arrays are objects, they are always passed by reference.
Access Modifiers
  • public access modifier allows access outside of the members package. A class,constructor,method and variables can be declared as public.
  • private access modifier allows access only from within the class. A constructor,method and variables can be declared as private. A class cannot be declared as private.
  • protected members can be accessed only by classes within the same package and its subclasses in any package. A constructor,method and variables can be declared as protected. A class cannot be declared as protected.
  • When no access specifiers are declared, the members can only be accessed within the same package. A class,constructor,method and variables can be declared without any access.
  • The accessibilty hierarchy from most restrictive to least restrictive is as follows :
    private -> package(default) -> protected -> public
  • Access specifiers are used to provide encapsulation.
Static Modifier
  • static access modifier is applicable to a class a whole and not to any particular instance.
  • A method or a variable or a block of code can be declared as static.
  • When a variable is declared as static, there is only one copy for all instances of the class. If any one of the instance change the value, the change gets reflected to other instances.
  • When a method is declared as static, it can be called without creating an instance of the class.
  • A static method should not refer to instance variables without using an instance of the class. 'this' keyword should not be used when referring to the instance.
  • Static block gets executed when the class is loaded. Static block gets executed even before instance creation.
Final Modifier
  • classes,methods and variables can be declared as final.
  • A class declared as final cannot be inherited.
  • A method declared as final cannot be overridden.
  • A variable declared as final may not be changed.
Abstract modifier
  • abstract modifier is used to defer implementation to the subclass i.e to provide abstraction.
  • classes and methods can be defined as abstract.
  • abstract classes cannot be instantiated.
  • abstract method doesn't have a body and it is replaced with a semicolon.
  • abstract class may or may not have abstract methods but if a class has one abstract method then the class should be abstract.
  • abstract class can have non abstract methods.
  • abstract without being inherited is of no use. Hence an abstract class cannot be declared as final.
Synchronized Modifier
  • methods and blocks of code can be declared as synchronized.
  • synchronized methods can be accessed by only one thread concurrently for an instance.
  • A class level lock has to be acquired to execute a synchronised static method.
Transient Modifier
  • only field(instance) variables can be declared as transient. Local variables cannot be declared as transient.
  • transient variables may not be serialized.
Native Modifier
  • only methods can be declared as native.
  • native modifier indicates method accessing code written in other programming language.
Volatile Modifier
  • only field(instance) variables can be declared as volatile. Local variables cannot be declared as volatile.
  • volatile variables cannot be declared as final.
  • volatile variables may be modified asynchronously by concurrently running threads.
Flow Control
  • if..else and switch..case are conditional statements.
  • for,while and do..while are iterative or looping statements.
  • The following are examples of endless loops:
    for( ; ; ){}
    while(true){}
  • do..while(condition) loop will get executed atleast once. while(condition) loop will only get executed on the condition being true.
  • break statement and default condition in switch statement are optional.
  • break statement inside a loop causes the control to come out of the loop.
  • continue statement inside a loop causes the control to continue with the next iteration.
  • There is no goto statement in java.
  • Unreachable code results in compilation error. The following is an example:
    while(false ){
    Sytem.out.println("unreachable code");
    }
Constructors
  • Constructors are used for initializing an instance.
  • Constructor name should be the same as the class name.
  • Constructor's doesn't have a return type.
  • Constructors are not inherited.
  • Constructors can be overaloaded.
  • When no constructors are specified, java provides a no argument constructor by default.
  • this() is used to access overloaded constructors and super() is used to access parent-class constructors.
  • this() or super(), if used,should be the first line of the constructor code block.
  • this() and super() cannot be used at the same time in the constructor.
Inheritance,Overloading,Overriding
  • In Java, Polymorphism is achieved using inheritance,overloading and overriding.
  • Java supports only single inheritance.
  • extends keyword is used for inheritance.
  • A class cannot extend more than one class.
  • A subclass inherits only the non-private members of the parent class.
  • Methods and constructors can be overloaded. Overloading is used for code simplicity and runtime polymorphism.
  • Methods in the same class with same name but different arguements and return type is said to be overloaded. A method is not overloaded, if the return type alone is different.
  • Only methods can be overridden. Overriding is used to provide a different method behavior in the subclass.
  • Overriding method in the subclass must have same signature and return type as the overriden method of the super class.
  • Overriding method cannot reduce the access visibility (private is most restrictive) but it can increase the access visibility (public is least restrictive).
  • Overriding method can only throw exceptions that the overridden method in the super class throws or it may not throw any exception at all. But it cannot throw new exceptions from different class hierarchy.
Interfaces
  • Interfaces along with abstract classes provide abstraction in java.
  • Interfaces are used to define abstract methods and constant(static final) variables.
  • Classes use implements keyword to make use of interfaces. A class can implement any number of interfaces.
  • An interface can extend more than one interface. But the same is not true for classes.
  • A class implementing a interface should provide implementation for all the methods declared in the interface. If it doesn't, the class becomes abstract.
  • Variable declartion inside a interface can be public or package access and/or abstract.
  • Methods declartion inside a interface can be public or package access and/or static/final.
Exception Handling
  • java.lang.Exception is the base class of all exceptions.
  • java.lang.Throwable is the super class of Exception and Error classes.
  • Java uses try..catch..finally constructs to handle exceptions.
  • finally block will be executed whether or not an exception is thrown.
  • finally block can exist with a try block without a catch block. The exception blocks can be in any of the following combinations - try{}catch(){} or try{}catch(){}finally{} or try{}finally{}.
  • Checked exceptions and unchecked exceptions are the ways of classifying exceptions.
  • Checked exceptions needs to be explicitly handled using throws clause or catch block.
  • Unchecked exceptions are runtime exceptions ie subclass of java.lang.RuntimeException and need not be explicitly handled.
  • throw is used to explicitly raise a exception within the program.
  • throws clause is used to indicate the exceptions which are not handled by the method. If multiple exceptions are not handled, then they are separated by a comma.
  • An overriding method in a subclass must only throw exceptions declared in the parent class or children of the exceptions declared in the parent class or the overriding method may not throw any exception at all.
  • The subclass exception should precede the base class exception when used within the catch clause.
  • System.exit() will abruptly terminate the JVM. Hence if there is a System.exit() statement in the try/catch/finally blocks, finally will not complete.
Garbage Collection
  • In Java, Garbage Collection is automatic. No explicit coding (like destructors) is required.
  • Garbage Collector Thread runs as a low priority daemon thread freeing memory.
  • An Object is eligble for garbage collection, when there are no references to the object.
  • System.gc() and Runtime.gc() methods inform the JVM to run garbage collection but this is only a request to the JVM and it is up to the JVM to run GC immediately or run it when it gets time. Garbage collection can't be forced.
  • finalize() method is called by the GC just before releasing the object's memory. It is advised to do a final cleanup of the object in finalize() method.
  • When an object is not required, its reference may be nullified which increases the likelihood of garbage collection.
Threads
  • A thread is a single sequential flow of control within a program.
  • The following are the two ways to create a new thread:
    - Extend the Thread class and override the run() method.
    - Implement the Runnable interface and implement the run() method.
  • The following are the states of a thread :
    Ready - instance created but not yet started.
    Running - currently executing.
    Waiting - currently not executing.
    Dead - completed processing.
  • start() method puts the thread in ready state and makes the thread eligible to run. start() method automatically calls the run() method.
  • wait(), notify(), and notifyAll() are methods defined in the Object class. These methods throw InterruptedException.
  • wait() method releases CPU, releases object's lock and puts the thread into pool of waiting threads.
  • notify() method moves a thread out of the waiting pool to ready state, but there is no guaranty which thread will be moved out of the pool.
  • notifyAll() method moves all waiting threads from the waiting pool to ready state.
  • A Thread's priority will be same as the thread which started it. setPriority(int priority) is used to change the priority of a thread.
  • yield() is a static method of the thread class which puts currently running thread in to ready state.
  • sleep() is a static method of the thread class which puts the current running thread to its waiting state. sleep() throws InterruptedException at runtime.
  • setDaemon() method is used to make a thread as daemon thread. Daemon thread is a low priority thread which runs in the background.
  • A thread dies after the completetion of run() method. A dead thread cannot not be restarted.
  • methods and blocks of code can be declared as synchronized.
  • synchronized methods can be accessed by only one thread concurrently for an instance.
  • A class level lock has to be acquired to execute a synchronized static method.  

Friday, 16 August 2013


sizeOf()


Java does not have a sizeof operator like that in C/C++. All primitive types have a standard size (or at least appear to have a standard size), so you don’t really need one. There are typically no pad or alignment bytes.
Java Object Size
typesize in bytes
overhead~8 bytes/object
boolean1
byte1
char2
short2
int4
long8
float4
double8
reference4/8†
Stringlength * 2 + 4
† addresses are 4 bytes in a 32-bit JVM (Java Virtual Machine) and 8-bytes in a 64-bit JVM.
A JVM is free to store data any way it pleases internally, big or little endian, with any amount of padding or overhead, though primitives must behave as if they had the official sizes. For example, the JVM or native compiler might decide to store a boolean[] in 64-bit long chunks like a BitSet. It does not have to tell you, so long as the program gives the same answers. It might allocate some temporary Objects on the stack. It may optimise some variables or method calls totally out of existence replacing them with constants. It might version methods or loops, i.e. compile two versions of a method, each optimised for a certain situation, then decide up front which one to call. Then of course the hardware and OS (Operating System) have multilayer caches, on chip-cache, SRAM (Static Random Access Memory) cache, DRAM (Dynamic RAM) cache, ordinary RAM (Random Access Memory) working set and backing store on disk. Your data may be duplicated at every cache level. All this complexity means you can only very roughly predict RAM consumption.
There is a header on each object, typically 8 bytes for objects and 12 bytes for arrays, and 16 bytes in JET.
In Java version 1.5 or later you can use java.lang.instrument. Instrumentation. getObjectSize()
Other methods you may find useful in estimating RAM use:

Minimum and Maximum Possible Primitive Values

Primitive variables include boolean, char, byte, short, int, long, float and double. Strings, arrays and Objects are not considered primitives.
Java Primitives
TypeSigned?BitsBytesDigitsLowestHighestMnemonic
booleann/a111falsetruezero/one
charunsigned Unicode1624:5'\u0000' [0] aka Character. MIN_VALUE'\uffff' [216-1] aka Character.MAX_VALUEUnicode chars are twice as big as C’s.
bytesigned812:3-128 [-27] aka Byte. MIN_VALUE+127 [27-1]aka Byte. MAX_VALUEBytes are signed, so half the usual 255 range.
shortsigned1624:5-32,768 [-215] aka Short. MIN_VALUE+32,767 [215-1] aka Short. MAX_VALUE32K
intsigned3249:10-2,147,483,648 [-231] akaInteger.MIN_VALUE aka -2 gig, roughly -2 billion+2,147,483,647 [231-1] aka Integer.MAX_VALUE. aka 2 gig, roughly 2 billion2 gig
longsigned6481:19-9,223,372,036,854,775,807 [-263] akaLong. MIN_VALUE about -9×10189,223,372,036,854,775,808 [+263-1] akaLong. MAX_VALUE about 9×10189 exabytes, or 9 billion gig
floatsigned exponent and mantissa3247±1.40129846432481707e-45 aka Float.MIN_VALUE±3.40282346638528860e+38 aka Float.MAX_VALUE 
or roughly ±2127 
with about 7 significant digits of accuracy. 
A float can exactly represent integers 
in the range -224 to +224.
rough, compact float
doublesigned exponent and mantissa64816±4.94065645841246544e-324 aka Double.MIN_VALUE±1.79769313486231570e+308 aka Double.MAX_VALUE 
or roughly ±21023 
with 15 significant digits of accuracy, almost 16with 15.95 significant digits. 
A double can exactly represent integers 
in the range -253 to +253.
high precision float

Thursday, 8 August 2013

1.JAVA HISTORY

With Java, Sun Microsystems established the first programming language that wasn’t tied to any particular operating system or microprocessor.

Applications written in Java will run anywhere, eliminating one of the biggest headaches for computer users: incompatibility between operating systems and versions of operating systems.

The following paragraph will give some information about the history of Java and explain how this programming platform from Sun Microsystems was created.

Java’s core principles developed out of a desire to build software for consumer electronics. It all started out in 1990 when a team of Sun researchers developed some concepts for a new direction in high-tech, consumer-driven technology. Computers were everywhere and were the driving force behind many of the products in the home: the VCR, the microwave oven, the security system, and the stereo system.

However, each product required its own interface. In other words, to control three devices, consumers had to have three remote controls and to understand programming for three devices. In addition to the fact that Sun was falling behind on it’s competitors, this was the background for Sun to launch a new project which would later become Java.

A team code-named Green was formed to work on creating a simple device that controlled a variety of day-to-day electronics products. The team consisted of two programmers; Patrick Naughton and James Gosling, and engineer Mike Sheridan. Gosling realized that what they needed was a new programming language.

As it was, existing programming languages like C++ had its emphasis on speed, not reliability. In consumer electronics, reliability is more important than speed. As it turned out, Gosling and Naughton managed to bring their work together, and create a new language which they called Oak. This happened in August 1991. A year later, the Green Team had developed a hand-held device with no keyboard, no buttons, and a tiny screen. You touched the screen to turn it on and controlled the action on the screen with a fingertip. This made it possible to program the VCR just by moving your finger along the screen. Still, this technology did not take off. Amongst others the chips were too expensive to manufacture. Ultimately the Green Team was a failure.

However, Bill Joy, one of the co-founders of Sun, saw an opportunity for Oak in the emergence of the World Wide Web. His idea was to release Java for free over the Internet. By giving your product away for noncommercial use you can make it the standard. The name Oak had to be changed due to the fact it was too close to that of another product. Consequently, Oak was renamed Java in January 1995.

Today, Joy’s vision of free and accessible technology is a reality. But Sun still needs to make sure that Java becomes the standard; then it needs to figure out how to make money from the product. Selling commercial licenses is one way to go.

One big step was taken on December 7, 1995, when Microsoft signed a letter of interest with Sun for a Java-technology source license. Additionally, Microsoft agreed to give Sun Microsoft’s reference implementation of the Java virtual machine, and the apple application programming interface (API) for Windows. This deal was important. By integrating Java into its Explorer browse, Microsoft provided Java with a huge base of previously untapped Windows users. In addition, it was a major endorsement form the world’s largest software firm that Sun’s Interment technology is top-notch and goes a long way towards establishing Java as de facto open standard for programming on the Internet.
     

1.1.JAVA STEP BY STEP

     


January 15, 1991 

"Stealth Project" (as named by Scott McNealy) brainstorming meeting in Aspen with Bill Joy, Andy Bechtolsheim, Wayne Rosing, Mike Sheridan, James Gosling and Patrick Naughton.
February 1, 1991
Gosling, Sheridan, and Naughton begin work in earnest. Naughton focuses on "Aspen" graphics system, Gosling on programming language ideas, Sheridan on business development.
June 1991
Gosling starts working on the "Oak" interpreter, which, several years later (following a trademark search), is renamed "Java."
August 19, 1991
Green team demonstrates basic user interface ideas and graphics system to Sun co-founders Scott McNealy and Bill Joy.
Summer 1992
Massive amounts of hacking on Oak, and related components.
October 1, 1992
Wayne Rosing joins from SunLabs (which had formed in July 1990) and assumes management of the team.
March 15, 1993
The development team, now incorporated as FirstPerson, focuses on interactive television after learning about Time Warner's RFP for its interactive cable TV trial in Orlando, FL.
April, 1993
NCSA Mosaic 1.0, the first graphical browser for the Internet, is released.
June 14, 1993
Time Warner goes with SGI for its interactive cable TV trial, despite acknowledged superiority of Sun technology and assurances in mid-April that Sun won the deal.
Summer, 1993
Naughton flies 300,000 miles selling Oak to anyone involved in consumer electronics and interactive television; meanwhile, the rate at which people are gaining access to the Internet reaches breakneck speed.
August, 1993
After months of promising negotiations with 3DO to provide set-top box OS, 3DO president Trip Hawkins offers to buy the technology outright. McNealy refuses, and deal falls through.
September, 1993
Arthur Van Hoff joins team, originally to do application development environment aimed at interactive television; ends up doing mostly language design.
February 17, 1994
Alternative FirstPerson business plan for doing CD-ROM/online multimedia platform based on Oak presented to Sun executives to very mixed reviews.
April 25, 1994
Sun Interactive created, half of FirstPerson employees leave to join it.
June, 1994
"Liveoak" project started. Designed by Bill Joy to use Oak for a big small operating system project.
July, 1994
Naughton reduces the "Liveoak" project's scope to simply retargeting Oak at the Internet after writing a throwaway implementation of a Web browser in a long weekend hack.
September 16, 1994
Jonathon Payne and Naughton start writing "WebRunner," a Mosaic-like browser later renamed "HotJava"
September 29, 1994
HotJava prototype is first demonstrated to Sun executives.
Autumn, 1994
Van Hoff implements Java compiler in Java. (Gosling had previously implemented it in C.)
May 23, 1995
Sun formally announces Java and HotJava at SunWorld '95.
May 23, 1995
Netscape announces its intention to license Java for use in Netscape browser.
September 21, 1995
Sun-sponsored Java development conference held in New York City.
September 25, 1995
Sun announces expanded alliance with Toshiba and a joint project to develop remote information retrieval products which incorporate Java.
September 26, 1995
Sunsoft announces suite of business-oriented development products incorporating Java.
October 30, 1995
Oracle announces its WebSystem suite of WWW software which includes a Java-compatible browser.
October 30, 1995
At the Internet World Conference in Boston, Lotus Development Corp., Intuit Inc., Borland International Inc., Macromedia Inc.,and Spyglass Inc. announce plans to license Java.
December 4, 1995
Sun and Netscape announce Javascript, a scripting language based on the Java language which is designed to be accessible to non-programmers.
December 4, 1995
Sun, Netscape and Silicon Graphics announce new software alliance to develop Internet interactivity tools.
December 4, 1995
Borland, Mitsubishi Electronics, Sybase and Symatec annouce plans to license Java.
December 6, 1995
IBM and Adobe announce licensing agreement with Sun for use of Java.
December 7, 1995
Microsoft announces plans to license Java during announcement of suite of new Internet products, including Visual Basic Script.