Java: A brief overview By Sushil K. Guragain
Bellevue University
Bellevue, NE 68005
Prepared for the CIS 460 Class
Presented to: Prof. Tessa White


ABSTRACT
JAVA What is it? Some Features
Usage of JAVA Differences In Java & C++
What makes Java COOL?
Future of JAVA
Conclusion and Opinion
Works Cited

Go to Sushil's Homepage

ABSTRACT

We have been hearing a lot about Java these days. This raised me some curiosity to write this paper on Java.

This paper starts with some definitions of Java that we can commonly hear and shows some examples of Java being used these days. Increasing number of people are getting more interested towards learning and implementing Java because of its simplicity, portability and other features discussed later in this paper. There are a lot more features that drew people's attention toward Java. I have mentioned only a few among them.

Next, the paper gets more concentrated on comparing and listing the advantages of java over C++. There are more advantages than those listed in this paper, but I have picked the ones that drew my attention the most. Further, It shows some of the features that made Java more attractive than C++. Some of the advantages described are the simplicity and more web oriented features of Java.

Finally, the paper briefly discusses about the future of Java and concludes with my opinion and feeling. So far as citing the sources is concerned, I have given the last filename and extension of the sources that are from the web and shown the full address in the "Works Cited" page. For other references that are from books and articles, I have tried to follow the standard paper writing format. (Use the last name of the author and year in the place where the source is used and show the full description of the source in "Work Cited" section).


JAVA: What is it?

Some Definitions:

JAVA is both a programming environment and a language produced by Sun Microsystems Inc. JAVA was created as part of a large project at Sun whose mission was to develop complex and advanced software applications intended for small electronic devices(Tittel,, 1995)

JAVA is one part of the integrated set of systems that support WWW communication -an easy-to-use object-oriented programming language that operates independently of any operating system or microprocessor. It is designed for creating live online applications that link together objects and resources on both clients and servers(Paolini, 1994)

Arthur van Hoff of Sun Micro Systems Inc. described JAVA as a programming language originated in 1991, intended for the consumer electronics market, and based in traditional programing language that is safe, robust, fast, multi-threaded and object-oriented on the last day of the World Wide Web Conference (Guzmich, 1995).

The author of the Java FAQ defines Java as follows: "Java, formerly known as oak, is an object-oriented programming language developed by Sun. It shares many superficial similarities with C, C++, and Objective C ; but it is not based on any of those languages, nor have efforts been made to make it compatible with them." Java FAQ

On defining Java in part 6, Marshal Brian writes "Java is a complete object oriented programming language derived from C++ . It has all of the OO advantages of C++, but does away with a number of the more unpleasant aspects like pointers and memory allocation in the name of sanity, robustness and security." in his paper on Web Development Series (webdev6.stm).

In this way, different people define Java in different ways but all mean the same thing. That is, it is both an object oriented programming language and a programming enviornment. This is known to be a simple, distributed, interpreted, robust, secure, architecture neutral, multithreaded and dynamic language. It was invented to get rid of the problems(C++ had) without losing the object oriented and other good features that C++ had.

Where Did Java Come From?

The author explains in detail about where did JAVA concept and program come from on Java FAQ. He/she has given some first hand information on the originators of JAVA. According to him/her:

JAVA was developed during a work on a huge project called "Green Project" with Patrick Naughton, James Gosling and Mike Sheridan. They started working on this project since1991. But it wasn’t the first time they were looking for easier and better language. Both Naughton and Gosling had thought about from late 70’s. In 1992 , Green project was set up as ‘First person Inc.’, a wholly owned subsidiary of Sun which eventually rolled back into Sun in 1994. At that time they made the third redirection on the project. This time it was at the web. Patrick Naughton wrote a prototype browser called WebRunner in one weekend of inspired hacking. This browser became ‘Hot Java’ after some additional work by Naughton and Jonatha Payne. In this way JAVA was developed.(Java FAQ)


Some Features of JAVA:

Everybody seems to emphasize the following features of Java when they define it:

Based on C++

JAVA looks similar to C++ because JAVA began as C++. The group of software engineers that developed JAVA did not intend to create a new programming language. They wanted to build consumer-electronic devices and write the software for such devices (Waldo, 1996).

Because the developers decided that the language was more complicated than necessary, and since it didn’t guard against some common programming errors, a new language was created - JAVA (Waldo, 1996). JAVA is an object-oriented language which has the familiarity of C++, but it's smaller, simpler, more robust, and more secure . Many features of C and C++ have been omitted because they promote programming errors, are security risks, or add unnecessary complexity to the language. Even though C++ was rejected as the implementation language, keeping the language familiar resulted in JAVA looking very much like C++ (Executive Summary, 1996). Making the JAVA language a minimal subset of C++ while simultaneously retaining it's "look and feel", without the unnecessary complexities, means that programmers can migrate to the JAVA language easily, with the JAVA language learning curve as low as a couple of days (Gosling, McGilton, 1995).

Complete Object Oriented:

The JAVA language was designed as an object-oriented language from the ground up. To function in these increasingly complex, networked-based environments, programming systems must adopt object-oriented techniques (Gosling, McGilton, 1995). Object programming is ideally suited for the Net-era-when computers will function more as multimedia communication devices and less like "glorified calculators and typewriters." "The result of this is that software takes its place as a means rather than an end," says Clifford J. Reeds, director of IBM workgroup architecture (BusinessWeek, 1995). JAVA provides a clean and efficient object-based environment. With the exception of its primitive data types, everything in the JAVA language is an object (Gosling, McGilton, 1995).

Java is sometimes referred to as C++ ++ - -

The language was originally created because C++ proved inadequate for certain tasks. They added a few things C++ doesn't have like garbage collection and multithreading; and they threw away C++ features that had proven to be better in theory than in practice like multiple inheritance and operator overloading.(JAVA FAQ)

A number of features have been added to Java to make it safer including true arrays with bounds checking, garbage collection, concurrency, interfaces (from Objective C) and packages. There is no need to explicitly allocate or free memory in Java.

The elimination of more features of C and C++ was required to allow Java for secure execution fo the code across a network. Some of the features removed are: #define, typedef, operator overloading, enum, unions and structs. The main feature removed to make Java safer and more robust than C++ are pointers and pointer arithmetic.

Other features removed include global variables, standalone functions (everything is a method), friend functions (Everything in a package is a friend of everything else in the package.) and non-virtual functions.( Java FAQ)

Portable and Dynamic Language:

Java was designed not only to be cross-platform in source form like C, but also in compiled binary form. Java is compiled to an intermediate byte-code which is interpreted on the fly by the Java interpreter. Thus to port Java programs to a new platform all that is needed is a port of the interpreter and a few native code libraries.( Java FAQ)

Java makes consumer online banking cost effective and easy to use because of its portable nature. The solution lies in re-writing the online banking software in Java. That version will run on both the PC and the Mac. No need to ship disks: consumers receive the software automatically when they log onto the bank's web site on the Internet. That means the original software plus any updates are downloaded invisibly whenever the customer uses the bank's software.(case1.html )

Java is a more dynamic language than C and C++ in many ways. Java Libraries can freely add new methods and instance variables without any effects on their clients. Java also understands interfaces- a concept borrowed from objective C which is similar to a class. An interface is simply a specification of a set of methods that an object responds to. It does not include any instance variables or implementations. Unlike classes, Interfaces can be multiply inherited and they can be used in more flexible way than the usual rigid class inheritance structure.(java/index.html)

A Java program, accessible via the World Wide Web, allows customers to enter data directly via a user-friendly, customized interface. The data is sent immediately back to the consulting company's servers, and analyzed by the appropriate financial model. Results are sent back as soon as the calculation is finished. They are displayed directly on the client's computer, using on-the-fly graphs and charts or interactive 3-D models. Clients receive quick service and intuitive, interactive reports. Analytic services reduce overhead on data entry and can serve more clients at a lower cost because this will reduce the time period for consulting and feedbacks. ( case3.html))


Usage of JAVA:

In Different Corporations:

These days, different companies are using Java for various purposes. Here are some of the examples Java being used.

Fed Ex: Susan Goelder, manager of Internet Technology at FedEx Corporation in Memphis, is forming a picture of an Internet application that makes use of JAVA. In the near future, registered FedEx customers will be able to dispatch a courier by using the company’s web page. Users will key in a registration code and a digital identification and then receive a "from" form already filled out. An electronic address book written in JAVA and stored on the client will look up the "to" information of frequent receipients. After checking a few more boxes electronically, users will transmit the page and trigger a courier request(Kay, 1996).

CADIS Inc. founded in 1991 , develops and markets interactive search and retrieval technologies. Their newest search engine, the Krakatoa search engine, is said to be the first large scale business application built using Java. Krakatoa acts as a front end to a database or knowledge base. When a user goes to the website, and searches the knowledge base, the client invokes the Krabatoa applet. Users interact with the knowledge base in a Java runtime enviornment. A series of interactive questions are asked, the user answers them, and each answer narrows down the search until the correct item is identified.(Liederman, 1995)

National Semiconductor has two Java projects in the works. One lets users of any Java-enabled browser click on audio/visual links and witness live feeds. The other application lets design engineers execute complex queries against National Semiconductor’s product database of 30000 items (Kay, 1996).

On the Web

Java has been widely used in web for various purposes. WWW is one of the mostly advantaged place due to the evolution of Java. If we look at the Java applets being used on the web today, we can find that a web developer uses Java for the following tasks:


Differences In Java & C++

Garbage Collection:

Garbage Collection is one of the features they added in Java. It is the usage of memory that is not being used. Kashyup gives an outline on how garbage collection works in his paper as:

No Pointers in Java:

Java does not have pointers but it has references. A reference is an abstract identifier for an object. A reference tags a particular object with a name in the Java virtual machine so that the programmer may refer to it. How exactly the virtual machine implements references at the level of machine code is VM-dependent and completely hidden from the programmer in any case. Most VMs including use handles, not pointers. A handle is a pointer to a pointer. At the level of machine code in the CPU a reference is an address in memory where the address of the object is stored. This way the objects can be moved around in memory and only the master pointer needs to be updated rather than all references to the object. This is completely hidden from the Java programmer, though. Only the implementer of the virtual machine needs to worry about it. Indeed, this is not the only way references can be implemented. (Java FAQ).

No pre-processor in Java:

In C++, the main use of #include is to import class definitions for compiling, and Java has other ways of doing that. The use of #define for simple named constants is also handled in Java by final variables (Similar to const variables in C++). The pre-processor is often used in C++ for conditional compilation for various platforms, releases and compilers. Some of these are not concerns for Java because the Java Virtual Machine is universal (neutral.html).

Some other Differnces in Java compared to C++ are as follows:


Why is Java so Cool ?

Lesser Bugs:

Java was designed to make it a lot easier to write bugfree code. Shipping C code has, on average, one bug per 55 lines of code. About half of these bugs are related to memory allocation and deallocation. Thus Java has a number of features to make bugs less common:
* Strong Typing
* No unsafe constructs
* The language is small so its easy to become fluent.
* The language is easy to read and write. Obfuscated Java isn't
nearly as common as obfuscated C.
* There are no undefined or architecture dependent constructs.
* Java is object oriented so reuse is easy.
* Java has concurrency.
(webdev6.stm)

Simpler Language(Easier to Learn):

" Java is in fact a much easier language to learn than C++." says the writer of Java FAQ adding that it isn't even necessary to know Java to write Java programs.(Java FAQ) Java throws away the features that makes C++ harder to learn like #define, typedef, operator overloading, enum, unions and structs. The main feature removed to make Java safer and more robust than C++ is pointer arithmetic. This was a real pain for the C++ learners.

The addition of auto garbage collection has made programmers to write the programs in much more easier manner. Another reason for being simple and easier to learn is being small. It is a smaller language than C++ but it is going to come with richer class library than that of C++.

Java Advantages on the Web:

Security Features: At the lowest level the advantage of Java to the web is that it provides a secure, cross-platform way for code to be executed. Java adds several other features to existing web sites:

Java Provides higher level of security

Java was designed from the ground up to allow for secure execution of code across a network, even when the source of that code was untrusted and possibly malicious.

On a system level Java applets live in a cage. They can do pretty much anything they want inside their cage, but they cannot get outside the cage and do damage unless the user unlocks the door to the cage. Even then they wear shackles that prevent them from doing things like writing to arbitrary addresses in memory.(Java FAQ)

No other language has the built-in security of Java. The key here is the security features. The object-oriented nature of Java is secondary, and mainly reflects the preferences and prejudices of the developers who set out to write a secure language. The C-like syntax of the language is even less crucial.(pluses.html)

Specifically a Java applet cannot write anything to a hard drive. It cannot write directly to memory, and it cannot introduce a virus into your system.(Java FAQ)

Java is a more modern and advanced language:

C++ is a fairly recent language, but compared to Java, it's old. During its early days, C++ followed some fairly strong policies about how it would function as a language. Some of these were design issues; some were practical issues. Most were set by Bjarne Stroustrup, the designer of C++. In addition, Java has been able to take advantage of new language technology - for example, advances in automatic garbage collection and "just-in-time compiling." (mindset.html)

"If you made the move from C to C++, you may have felt that you were giving up some of the control you had over the machine because C++ did so much more for you "behind your back". Moving from C++ to Java gives you the same feeling. You have to trust the compiler even more than before." says the author of Web development Series on the web. (webdev6.stm)

Compiler does many complicated things :

All pointer manipulation is done by the compiler:Java takes away the burden of pointer manipulation from the developer. Objects are actually pointers, but there is no need to de-reference objects, take addresses or use a special notation. All that is handled internally by the compiler.(Java FAQ)

We've all been told time and time again to make it run first, then make it run fast. But C++ by its very nature lends itself to some optimization as you write. Java doesn't give you as much control, so there's less temptation to optimize as you write. The basic idea is that you write sound and "correct" code, and leave it up to the compiler to do most of the optimization. You can hand-optimize some things, but Java encourages you to do this later rather than earlier.(pluses.html)

Java doesn't use header files. An entire class is written in a source file. The compiler can look at other files when compiling a class to check function prototypes and access specifiers. (pluses.html)

Other Advantages

Here are the advantages of Java over C++, listed by Gihan in his paper:

Source: (plusses.html)

Some Disadvantages

Here are a few areas where C++ has some better features:

BUT WE CAN STILL DO THE THINGS WE CAN DO WITH C++ BY USING JAVA

Making a Linked list without pointers: "We can make a linked list in Java by using the Vector class in java.util. It can do anything a linked list can do and a little more and saves you a lot of coding which, after all, is the point of OOP and the class library. However it is array based so insertions or deletions from the middle of a Vector are not as efficient as with a true linked list." states the writer of FAQ of Java. (Java FAQ)

Multiple Inheritance: We can achieve the multiple inheritance by declaring interfaces for each additional class you want to inherit from, and implement those interfaces in your subclass. ( Java FAQ )

Constant: To get the constant feature of C++, we can make a static field final( it can no longer be subclassed). We can also make a class or members a final.

Writing an object to and from a file is little harder in Java. There is no general method for doing this in Java 1.0. In Java 1.1 a serialization interface has been added to the language. However only objects that explicitly implement the java.io.Serializable interface can be serialized.(Java FAQ)


Future of Java:

Arthor Van Hoff of Sun Microsystems Inc.,(company that is actively working on the development of JAVA) said, in one of his WWW conference that some of the features to look forward to in JAVA's near future include JAVA script, native code generators, encryption and authentication APIs, 3D libraries, database access, and audio/video. (Guzmich, 1995 )

In the future, with more bandwidth, Hoff said that SUN could evolve and extend JAVA's APIs, and make JAVA the programing standard for the Internet. His view is that JAVA can become the new model for Internet programming, and the catalyst for the consolidation of emerging standards. JAVA could promote an open yet standardized environment, avoiding the creation of a monopoly that would prevent the growth of Internet technology. Hoff said that JAVA technology will provide uniform and universal APIs for programming on the Internet, and will enable a new class of applications, replacing PCs, MACs, and UNIX workstations as the foundation for which Internet applications will be designed. (..17/java.html)

"In a couple of years parameterized types (i.e. templates) may be added to the language. In particular Sun is working on extensions for 3D, multimedia, telephony, and improved graphics." says the author of Java FAQ.

In this way, Java seems to be used widely in the Internet and some other applications too. The programming in the Internet seems to be handled by using Java language in the future.


Conclusion and Opinion:

Java seems to have a lot of better features than C++ but it doesn’t mean that C++ is worthless now. C++ also has some features that JAVA doesn’t support. Still, due to its simplicity, rich library and possible wide range of usages specially with the Internet, Java seems to have a bright future. To the students, Java would be a good language to learn because of its increased scope in the market. Many people who know both Java and C++ accept that Java is much easier language to learn than C++ and we do not require to know C++ to learn JAVA. Therefore, it will be worthwhile to learn Java, which opens up a lot more scope in the market.

Java is a fairly new language but it has many features that we needed and didn’t have in C++. Since it can perform almost every tasks that is accessible through C++ and we can do a lot more with it, Java would be a very good thing to know from the point of view of other users. It is an advanced, portable and dynamic language and it can run on a standalone computer too. Since the program is easier, it has automatic garbage collection feature and the programs are architecture neutral it will be a very powerful tool to the programmers which they can use in their programming life after knowing it. Because of its potential use in a wide range of places and because of its increasing usage trend, Java seems to be used widely in the future and open up a lot of opportunities in the market for Java programmers.


WORKS CITED:

December, J. Presenting Java. Indianapolis, IN: Sams.net Publishing, 1995.

Golsing, J., Mcgilton, H. "The Java Language Enviornment - A white Paper." Mountain, View, CA: Sun Microsystems, 1995. (Available : http://www.sunsite.informatic.rwth-aachen.de/java/1.0alpha3/doc/overview/java/index.html.)

Tittel, E., Gaither, M. "60 Minuate Guide to Java." Froster City, CA: IDG Books Worldwide, Inc., 1995.

Vertify, L. "Meet Java, the Invisible Computer". Business Week , December 4, 1995.

(Available: http://www.businessweek.com/week49/b549cov2.htm)

Waldo, J. "Programming With JAVA." UNIX Review May, 1996, 14(5) pp: 31-37.

"Will Your Next Computer Be a Tin Can and Wire?" The Economist, October 14, 1995 p:75.

Paolini, G. "Netscape and Sun Announce JavaScript, The Open Cross-Platform Object Scripting language for Enterprise Networks and the Internet" [Press Release]. Sun Microsystems, Inc. ,1994 December 4, 1994.

Gosling, J., Arnold, K., "The Java Programming Language." Mountain View, CA: Sun Microsystems, 1996.

Kay, R. "Java at Work", Computerworld, May 13, 1996; 30(20). pp: 85-88.

Liederman, E. "Java in the Real World". JavaWorld. March, 1995.

(Available: http://www.javaworld.com/jw-03-1996/jw-03-realworld.html)

Gumich, Eileen M., D’Alessandro, Anthony. "Hoff Speculates on the Future of JAVA" December 14, 1995.

(Available :http://www.bellcore.com/WWWCONF/ARTICLES/17/java.html)

WEB SITES REFERENCED:

http://www.q.net.au/~gihan/doc/javaacc/mindset.html

http://www.q.net.au/~gihan/doc/javaacc/plusses.html

http://www.q.net.au/~gihan/doc/javaacc/minuses.html

http://www.q.net.au/~gihan/doc/javaacc/neutral.html

http://www.randomwalk.com/services/case1.html

http://www.randomwalk.com/services/case3.html

http://www. bellcore.com /WWWCONF/ ARTICLES/17/java.html

http://ftp.cs.umn.edu/users/ried1/CS-8103/kashyap.txt

http://www.iftech.com/oltc/webdev6.stm

http://www.mcc.com/projects/infosleuth/papers/intranet-java.html.

Java FAQ available on the web at: http://www.lib.ox.ac.uk/internet/news/faq/archive/computer-lang.java.part1.html


THE END!!

  • Back to the main page 1