Canalblog
Suivre ce blog Administration + Créer mon blog

welcome to googlefans

8 février 2006

Java is small

One of the features of Java which Sun neglected to mention in its definition was Java's size-or lack of it. As a side effect of being simple, Java is a very small. Remember that one of the original goals of Java was to facilitate the construction of software that ran stand-alone in small machines. The original *7 module that Java was developed for only had 3Mb of main memory. Java can happily run on personal computers with at least 4Mb of RAM or even VCRs, telephones, or doorknobs.

The size of the basic interpreter and class support is about 40K of RAM; adding the basic standard libraries and thread support (essentially a self-contained microkernel) adds an additional 175K. The combined total of approximately 215K is significantly smaller than comparable programming languages and environments.

Java is simple, (small), object-oriented...

Java is an object-oriented language. That means that it's part of a family of languages that focuses on defining data as objects and the methods that may be applied to those objects. As we've said, Java and C++ share many of the same underlying principles, they just differ in style and structure. Simply put, object-oriented (OO, for short) languages describe interactions among data objects. To make an analogy with medicine, an "object-oriented" doctor would be interested in holistic medicine - examining the body (or object) as a whole first, and the vaccines, diets, and medicine (the tools) used to make your health improve after that. A "non-object-oriented" doctor would think primarily of his tools.

Many OO languages support multiple inheritance, which can sometimes lead to confusion or unnecessary complications. Java doesn't; as part of its "less-is-more" philosophy, Java only supports single inheritance. That means that each class can only inherit from one other class at any given time. This avoids the problem of a class inheriting classes whose behaviors are contradictory or mutually exclusive.

Having said that, we should point out that, while Java does not support multiple inheritance per se, it does support abstract classes which can implement multiple inheritances. Abstract classes allow programmers to define methods for interfaces and worry about how the methods will be implemented later. This bypasses a lot of the problems inherent in actual multiple inheritance while still retaining most of the advantages.

Each class, whether abstract or not, defines the behavior of an object through a set of methods. All the code used for Java is divided into classes. Behaviors can be inherited from one class to the next, and at the head of the class hierarchy is the class called "Object". This is illustrated in figure 1.1, which shows a class called "meat" that inherits from class "Food", which, as all classes ultimately do, inherits from the class called OBJECT.

Objects can also implement any number of interfaces (or abstract classes, remember?). The Java interfaces are a lot like the Interface Definition Language interfaces. That similarity means that it's easy to build a compiler from IDL to Java.

That compiler could be used in the CORBA (Common Object Request Broker Architecture) system of objects to build distributed object systems. Is this good? Yes. Both IDL interfaces and the CORBA system are used in a wide variety of computer systems and this facilitates Java's platform independence, which we'll talk more about later.

As part of the effort to keep Java simple, not everything in this object-oriented language is an object. Booleans, numbers, and other simple types are not objects, but Java does have wrapper objects for all simple types. wow goldWrapper objects allow all simple types to be implemented as though they were classes.

Object-oriented design is also the mechanism which allows modules to "plug and play." The object-oriented facilities of Java are essentially those of C++, with extensions from Objective C for more dynamic method resolution.

Publicité
Publicité
8 février 2006

What is Java?

Now that we've established the difference between a browser (HotJava, Netscape) and a programming language (Java), it's time to get down to what Java is.

The folks who designed Java hoped to solve some of problems they saw in modern programming. As we said, Java's core principles developed out of a desire to build software for consumer electronics. Like those devices, the language needed to be compact, reliable, portable, distributed, real-time, and embedded.

Like most modern products, Java can be neatly defined in a set of buzzwords. Sun Microsystems' official definition Java is:

Java: A simple, object-oriented, distributed, interpreted, robust, secure, architecture neutral, portable, high-performance, multithreaded, and dynamic language.

Java is Simple...  求职, 招聘找易才网

Even though the Java developers decided that C++ was unsuitable for their purposes, they designed Java as closely to C++ as possible. this was done in order to make the system more familiar, more comprehensible, and to shorten the time necessary to learn the new language. One of Java's greatest appeals is that, if you're a programmer, you already know how to use it. Ninety percent of the programmers working these days use C, and almost all object-oriented programming is done in C++.

Another goal of the designers was to eliminate support for multiple class inheritance, operator overloading, and extensive automatic coercion of data types; several of the poorly understood, confusing and rarely used, features of C++. Also omitted from Java were header files, pre-processor, pointer arithmetic, structures, unions, or multi-dimensional arrays. They were selective, and retained features that would ease development, implementation, and maintenance of software, while omitting things that would slow a developer down. For example, even though operator overloading was eliminated (which lets programmers exists when operators have more than one semantic interpretation) they kept method overloading.

8 février 2006

Why is Java so hot?

You can make up whatever coffee metaphors you like, but there's no getting around the fact that Java is the most exciting thing to hit the Internet since the World Wide Web. That's because it fills a need-several needs, in fact. With Java, programmers are able to deliver what everyone who uses the Web has been clamoring for-true interactivity.

First of all, Java is a programming language. Languages are used to compose a set of instructions which a computer follows. These groups of instructions are called programs, applications, executables, or , in the case of Java, applets. Java can also be used to build stand-alone programs, called applications, just like any other programming language. It's the applets that are the most innovative thing about Java.

Java applets, as discussed in the introduction, add life to the World Wide Web. By "life" I mean that with Java you can add animation, local data searches, wow goldand a wide variety of other functions and features that just weren't possible without the Java environment. It's not surprising that companies from Netscape to America Online have jumped on-board the Java bandwagon to design the next generation of browsers.

This brings us to browsers. In order to look at the Web, you need a browser. A browser is an application which runs over the Internet and interprets HTML code. There are graphical and non-graphical browsers, but we're only interested in the graphical ones (the ones that can display pictures on your screen). There are a lot of browsers available. Currently there are only two which support Java: Netscape 2.0 and HotJava.

Netscape 2.0 can be downloaded from

8 février 2006

The World of Java

by Alexander Newman

In this chapter, we'll talk a little bit about what Java is, in general terms. Java is in many ways similar to program languages that have gone before it, but there are a few key differences. Fortunately, the fact that there's a standard vocabulary used to describe computer languages makes our job a little easier.

Throughout the upcoming chapter, we'll see that Java's features are really all interrelated. You can't talk about Java security without discussing the fact that Java iswow gold interpreted by the browser. You can't discuss the fact that Java is interpreted as well as compiled without touching on architecture independence-and architecture independence is the cornerstone of Java's portability.

In this chapter you'll learn:

  • Why Java is so popular
  • How Java interracts with HTML
  • Java's defining qualities
  • Some of the differences between Java and C++
Publicité
Publicité
welcome to googlefans
Publicité
Publicité