I. Introduction
"『Java』" has received great attention in the computer industry since the summer vacation of 1995, especially in the internet and multimedia related products. Why is Java so attractive? People make this analogy: Java is on the World Wide Web (WWW), just like the relationship between spreadsheets and personal computers (PCs). So what are the characteristics of Java?
Java is a software technology.
Is a language developed by SUN Microsystems.
Is a computer language developed for the Internet.
Is a language that makes web pages produce vivid pictures.
It is a language that changes web pages from static to dynamic.
Is a language used to generate "applets".
It is a simplified C++ language and a safe language, which has the function of blocking the spread of computer viruses.
Is a language that puts security first.
It is a language that users don't need to spend much time learning.
It is a language that breaks through the client environment and CPU structure.
Is a "write once, run anywhere" language, which is the first language that allows users to transfer applications from remote servers to local machines and execute them through the Internet.
It is a language (Kestenbaum, 1995), in which application providers do not need to know the user's computer hardware (such as Sun, Intel or MAC) and software (such as SW- UNIX, MAC O/S, Windows or NT).
The following will introduce Java in order, first of all, the development history of Java and the introduction of Java language, followed by a brief introduction of Java Applet and HotJava.
Second, Java frequently asked questions
The following is a question and answer to explain the history and background of Java development (the following contents are compiled by Java FAQ list, Tutorial and Java Language: White Paper, please refer to the original text yourself if you want to know more):
When did Java begin to develop? (when)
The earliest date can be traced back to April of 199 1. Sun's green project began to develop consumer electronic products, using languages such as C, C++ and Oak (the predecessor Oak(Java language). Later, due to the language itself and market problems, the development of consumer electronic products could not reach the original expected goal. However, with the rise of the Internet, the green plan changed its development direction and has always been 1994.
Why Java? (Why) "Java" was selected by the Java development team of SUN Computer Company in the United States after numerous heated discussions. Liveliness, animation, speed and interactivity are the characteristics you want to express when you choose a name for the first time. "Java" stands out from countless suggestions. "Java" is not composed of the first letters of several words, but is inspired by the hot and fragrant coffee that many programmers like.
Who developed Java? (Who) Java was developed by the Java development team of SUN Computer Company in the United States. Its early members (Green Plan) were Patrick Naughton, james gosling and Mike Sheridan, and now the familiar member is james gosling.
Where was Java developed? (where)
That is to ask the birthplace of Java? The answer is America.
How to find the required Java information? (How)
On the Internet, you can use URL/ or/to connect to Sun's Java WWW website. You can find almost all the Java information you need there, but language is an obstacle, at least for some people; It doesn't matter. At present, many websites in China provide Chinese Java information. There are many related materials on FTP sites of Tsinghua and Chinese Academy of Sciences. Imagine that there should be more websites providing relevant information in the future.
How can I see the effect of Java? (How about me)
First of all, you need a browser with a Java interpreter, such as Netscape Navigator 2.0 or above of Netscpae or Sun's HotJava browser. For PC users, the operating system should be Windows 95 or Windows NT.
Because of the difficulty in writing C++ language programs, Java was developed. At first, it was only part of the big plan of consumer electronics. At first, C++ language was considered, but a series of problems from beginning to end forced it to give up C++ language, and Java language came into being. Sun hopes that Java is a simple, object-oriented, distributed, explanatory, robust, secure, architecture-neutral, portable, high-performance, multi-threaded and dynamic programming language.
In Sun's "White Paper on Java Language", the skills of the above Java language are clearly expounded. Taking carpentry as an analogy, an object-oriented carpenter, his or her main concern is the wooden chair to be made, followed by the tools needed; Conversely; Carpenters who are not object-oriented only care about tools. The recent plug and play is also the focus of object-oriented design. Distributed): JAVA has a very comprehensive introduction to Java.
One,
"『Java』" has received great attention in the computer industry since the summer vacation of 1995, especially in the internet and multimedia related products. Why is Java so attractive? People make such an analogy: Java's position on the World Wide Web (WWW) is like a spreadsheet with TCP/IP communication protocols such as personal computers TTP and FTP. Java applications can open and link objects on the network, just like using a local file system through a URL. Robustness: A program written in Java can be executed in various situations and has its stability. The biggest difference between Java and C/C++ is that Java has a pointer model to eliminate the possibility of overwriting memory and damaging data.
Security): Java is designed for use in network and distributed environment, and security is a very important consideration. Java has several levels of interlocking protection measures, which can effectively prevent the invasion and destruction of viruses.
Architecture neutrality: Generally speaking, the network consists of many different types of machines with different CPU and operating system architectures; Therefore, how to make an application executable on every machine is a difficult problem. Fortunately, the compiler of Java has produced a structure-neutral target file format. This enables the compiled code to be executed in various processors.
Portable: Specifies the size of the original data type. For example, "float" always represents a 32-bit IEEE 754 floating-point operand, because most CPUs have this same feature. Library is a part of the system, and Java itself has good portability by defining some portable program interfaces.
Explanatory): Java interpreter can directly execute Java bytecode on any machine, so it saves time when linking programs and is of great help to shorten the development process of programs.
High performance): Java bit code can be quickly converted into machine code, and the efficiency of converting from bit code to machine code is similar to that of C and C++.
Multithreading: Java language has the function of multithreading, which is helpful for interactive response and real-time execution.
Dynamic): Java is more dynamic than C or C++ and can adapt to the ever-changing environment. Java will not have to recompile the program because of the update of the library.
In addition, Hank Shiffman (Making Sense of Java) also puts forward his own explanation for the common misunderstandings and ideas about Java, which is translated as follows:
"Java is a language for writing web pages, just like HTML and VRML." In fact, Java is not a description language like HTML, but a programming language. Description languages represent content and location, while programming languages describe the process of producing results.
"Unlike C, C++ and other programming languages, Java is easy to learn and use."
Java is a programming language. Is Java easy to learn? Java may be easier to learn than C or C++, but it is still a programming language, not a description language.
3." Java code is portable, but C and C++ are not. "
Java source code is a little more portable than C language, and the difference lies in Java object code. Java code is compiled on one machine and can be executed on all machines, as long as there is a Java interpreter on that machine.
4." Java can be extended to do anything on the machine. "
Theoretically, Java Applet (Java do anything, such as simulating 3D VRML model, playing movies and generating audio. But in fact, applets can only be executed on that page, not outside that page. At the same time, Java is also limited by the function of the library.
5. "Java is suitable for building large-scale applications"
If Java is suitable for large programs, then it is not suitable for Web browsers. The earliest commercial Java applet (AppX's spreadsheet based on Java) didn't completely use Java, it just used Java as the user interface, and all the processing work was done in CGI code.
6. "Java is interpreted and executed, and Basic is interpreted and executed, so Java=Basic"
Although Java does use interpreters, in fact, Java is close to fully compiled languages such as C or C++, but not to fully interpreted languages such as Basic or APL.
"7." Java deleted CGI scripts and program requirements."
Java applet will replace the use of some CGI. In some cases, Java applets can replace some server-side codes, but in most cases, for security reasons or performance considerations, Java still cannot completely replace CGI scripts.
8. "Netscape's JavaScript is related to Java"
In addition to the name, Java and JavaScript have a little connection. JavaScript is a command scripting language that can be used in HTML pages. Java code does not appear in HTML, but the compiled code groups are linked by links in HTML. The relationship between Java and JavaScript is just like the relationship between C language and C Shell.