Java Tutorial

 

For Any Query Please Mail To parichowk@yahoo.com

Day 1(11/02/07)

What Is Java?

Java is an object-oriented programming language developed by Sun Microsystems, a company
best known for its high-end Unix workstations. Modeled after C++, the Java language was
designed to be small, simple, and portable across platforms and operating systems, both at the
source and at the binary level.

Java’s Past, Present, and Future

The Java language was developed at Sun Microsystems in 1991 as part of a research project to
develop software for consumer electronics devices—television sets, VCRs, toasters, and the
other sorts of machines you can buy at any department store. Java’s goals at that time were to
be small, fast, efficient, and easily portable to a wide range of hardware devices. It is those same
goals that made Java an ideal language for distributing executable programs via the World Wide
Web, and also a general-purpose programming language for developing programs that are easily
usable and portable across different platforms.

The Java language was used in several projects within Sun, but did not get very much commercial
attention until it was paired with HotJava. HotJava was written in 1994 in a matter of months,
both as a vehicle for downloading and running applets and also as an example of the sort of
complex application that can be written in Java.

Why Learn Java?

At the moment, probably the most compelling reason to learn Java—is that HotJava applets arewritten in Java.
Even if that were not the case,Java as a language has significant advantages over other languages and other programming
environments that make it suitable for just about any programming task. This section describes
some of those advantages

1.Java Is Platform-Independent.

Platform independence is one of the most significant advantages that Java has over other
programming languages, particularly for systems that need to work on many different platforms.
Java is platform-independent at both the source and the binary level.

"Platform-independence is a program’s capability of moving easily from one computer
system to another".

At the source level, Java’s primitive data types have consistent sizes across all development
platforms. Java’s foundation class libraries make it easy to write code that can be moved from
platform to platform without the need to rewrite it to work with that platform.
Platform-independence doesn’t stop at the source level, however. Java binary files are also
platform-independent and can run on multiple problems without the need to recompile the
source. How does this work? Java binary files are actually in a form called bytecodes.

"Bytecodes are a set of instructions that looks a lot like some machine codes, but that is not
specific to any one processor."

Things are different when you write code in Java. The Java development environment has two
parts: a Java compiler and a Java interpreter. The Java compiler takes your Java program and
instead of generating machine codes from your source files, it generates bytecodes.

2.Java Is Object-Oriented

To some, object-oriented programming (OOP) technique is merely a way of organizing
programs, and it can be accomplished using any language. Working with a real object-oriented
language and programming environment, however, enables you to take full advantage of objectoriented
methodology and its capabilities of creating flexible, modular programs and reusing
code.
Many of Java’s object-oriented concepts are inherited from C++, the language on which it is
based, but it borrows many concepts from other object-oriented languages as well. Like most
object-oriented programming languages, Java includes a set of class libraries that provide basic
data types, system input and output capabilities, and other utility functions. These basic classes
are part of the Java development kit, which also has classes to support networking, common
Internet protocols, and user interface toolkit functions. Because these class libraries are written
in Java, they are portable across platforms as all Java applications are.

3.Java Is Easy to Learn

In addition to its portability and object-orientation, one of Java’s initial design goals was to be
small and simple, and therefore easier to write, easier to compile, easier to debug, and, best of
all, easy to learn. Keeping the language small also makes it more robust because there are fewer
chances for programmers to make difficult-to-find mistakes. Despite its size and simple design,
however, Java still has a great deal of power and flexibility

Java is modeled after C and C++, and much of the syntax and object-oriented structure is
borrowed from the latter. If you are familiar with C++, learning Java will be particularly easy for
you, because you have most of the foundation already.
Although Java looks similar to C and C++, most of the more complex parts of those languages
have been excluded from Java, making the language simpler without sacrificing much of its
power. There are no pointers in Java, nor is there pointer arithmetic. Strings and arrays are real
objects in Java. Memory management is automatic.

Copyright © 2007 Site conception, owned and maintained by parichowk dot com

All rights reserved to parichowk dot com