Java language generation and features

Source: Internet
Author: User
History and status quo of Java

Java comes from Sun's Green Project. Its original purpose was to develop a distributed code system for household consumption electronic products, in this way, we can send e-mail to refrigerators, televisions, and other household appliances to control them and exchange information with them. At the beginning, we were prepared to adopt C ++, but C ++ was too complicated and had poor security. Finally, we developed a new language oak (the predecessor of Java) based on C ++ ), oak is a sophisticated and secure language for networking. Sun once bids for an interactive TV project, but the result is SGI's defeat. The poor oak was almost homeless. At this moment, mosaic and Netscape developed by Mark ardreesen inspired the oak project team members. They used Java to compile the hotjava browser and received support from Scott mcnealy, CEO of sun, this triggers Java to enter the internet. The name of Java is also interesting. One day, several Java member groups are discussing the name of the new language. At that time, they were drinking Java (Java) coffee in the cafe, the name of Java came out as soon as it was said, and was appreciated by others.

Java status quo

Java is a new generation of object-oriented programming language launched by Sun. It is especially suitable for Internet application development. Its platform independence directly threatens Wintel's monopoly. For a time, "connecting to the Internet and using Java programming" has become a fashion for technicians. Although some reports in the new news have been mentioned, Java, as a revolutionary technology in software development, has been established in the following aspects:
1. Many large companies in the computer industry have purchased Java licenses, including IBM, apple, Dec, Adobe, Silicon Graphics, HP, El, Toshiba, and the most reluctant Microsoft. This indicates that Java has been recognized by the industry.
2. Many software developers began to support Java software products. For example, Borland is developing a Java-based Rapid Application Development Environment latte, which is expected to be released in mid-1996. Borland's move pushed Java into the PC software market. Sun's own Java Development Environment java workshop has been released. Database vendors such as Illustra, sysbase, Versant, and Oracle are developing CGI interfaces, which support HTML and Java. Today's network-centric computing age does not support HTML and Java. the application scope can only be limited to homogeneous environments (the same hardware platform ).
3. Intranet is becoming the best solution for enterprise information systems, and Java will play an irreplaceable role. The purpose of Intranet is to use the Internet in an enterprise's internal information system. Its advantages include: low cost, easy to use and manage. Regardless of the type of machines and operating systems used, the user interface is a unified Internet browser, while databases, web pages, and applications (using Java-compiled applets) are stored on the WWW server, both developers, administrators, and users can benefit from this solution.
The Java language is constantly developing and improved. Sun is the main promoter of development. The general compiling environments include JDK (Java Develop Kit) and JWS (Java workshop ). Many other companies are developing the Java language compiler and integration environment. It is expected that the correctness and efficiency of the Java language will be improved soon, java programming is as convenient as C ++ programming.

Java features

What kind of language is Java? Java is a simple distributed interpretation of face-to-face objects robust and secure structure neutral portable dynamic language with excellent performance and multithreading.

Simple

Java was originally designed to implement integrated control over household appliances, so it must be simple and clear. The simplicity of the Java language is embodied in the following three aspects:
1. Java is similar to C ++, So C ++ programmers are very familiar with it. In a sense, Java is a variant of C and C ++. Therefore, C ++ programmers can quickly master Java programming technology.
2. Java discards the places in C ++ that are prone to program errors, such as pointer and memory management. 3. Java provides a wide range of class libraries.

Object-oriented

Object-oriented is the most important feature of Java. The Java language is completely object-oriented. It does not support process-oriented programming techniques similar to C. JAVA supports static and dynamic code inheritance and reuse. From the perspective of object-oriented features, Java is similar to Smalltalk, but other features, especially for distributed computing environments, far surpass smalltalk.

Distributed

Java includes a sub-database that supports HTTP, FTP, and other TCP/IP protocols. Therefore, Java applications can use URLs to open and access objects on the network in almost the same way as accessing local file systems. Providing Dynamic Content for distributed environments, especially the Internet, is undoubtedly a very ambitious task, but the syntax features of Java make it easy for us to achieve this goal.

Robust

Java is committed to checking program compilation and runtime errors. The type check helps to check for many early development errors. Java self-manipulating memory reduces the possibility of memory errors. Java also implements real arrays to avoid Overwriting data. This feature greatly shortens the Java application development cycle. Java provides NULL pointer detection array Boundary Detection for abnormal exit byte code verification.

Structure neutral

In addition, in order to establish Java as a whole of the network, Java compiles its program into a structure-neutral intermediate file format. This intermediate code can be executed on any machine running the system in Java. Currently, Java runtime systems include solaris2.4 (iSCSI) and Win32 systems (Windows95 and Windows NT. The Java source program is compiled into a high-level machine-independent byte-code format language, which is designed to run on a virtual machine and executed by the machine-related running debugger.

Security

Java security can be guaranteed in two aspects. On the one hand, C ++ functions such as pointers and memory release are deleted in Java to avoid illegal memory operations. On the other hand, when Java is used to create a browser, the language function is combined with the function provided by a browser to make it safer. The Java language has to be tested many times before it is executed on your machine. It passes code verification, checks the code segment format, detects pointer operations, whether object operations are excessive, and tries to change the type of an object.

Byte-code verification

If byte-code passes code verification and no error is returned, we can know that the Code does not have stack overflow or off-stack overflow. All operation code parameter types are correct, and no illegal data conversion occurs, for example, convert an integer to a pointer. The Access Object operation is legal.

Class Loading

Class Loader ensures security by separating the names of local classes and network resource classes. Because the check is always performed when the class is transferred, this avoids the appearance of Trojan horse. Classes downloaded from the network are transferred to a private Name field related to the source. When a private class accesses another class, build-in (local class) is checked first and then related classes are checked. This avoids the occurrence of damage to the local class.

Portable

The architecture-independent feature enables Java applications to run on any computer system equipped with a Java interpreter and runtime environment, which has become a good foundation for Java application software to facilitate transplantation. But that is not enough. If the basic data type design depends on the specific implementation, it will also cause great inconvenience to program porting. For example, in Windows 3.1, integer is 16 bits, 32 bits in Windows 95, 64 bits in DEC Alpha, and 32 bits in Intel 486. By defining basic data types and their operations independent of the platform, Java data can be consistent on any hardware platform. The basic data types and representation of Java are as follows:
Byte 8-bit binary Complement
Short 16-bit binary Complement
Int 32-bit binary Complement
Long 64-bit binary Complement
Float 32-bit IEEE 754 floating point number
Double 32-bit IEEE 754 floating point number
Char 16-bit Unicode Character

In any Java interpreter, data types are implemented according to the above standards. Because almost all the CPUs currently in use support the above data types, 8 ~ 64-bit integer complement operation and single/double precision floating point operation. The Java compiler is written in Java. The Java computing system is written in ansi c language based on POSIX's convenient porting restrictions. The Java language specification does not contain any content related to specific implementations.

Interpreted

The Java interpreter (running system) can directly run the target code commands. Linking programs usually requires less resources than compiling programs, so programmers can spend more time creating source programs.

High Performance

If the interpreter is not slow, Java can directly translate the target code into machine commands at runtime. Sun uses a direct interpreter to call up to 300,000 processes in one second. The speed of translating the target code is no different from the performance of C/C ++.

Multithreading

The multithreading function provided by Java enables multiple small tasks to be executed simultaneously in a program. A thread, also known as a small process, is a small independent process in a large process. Because of the multithreading technology implemented by Java, it is more powerful than C and C ++. The biggest benefit of Multithreading is better interaction and real-time control performance. Of course, the real-time control performance also depends on the system itself (UNIX, windows, Macintosh, etc.), in terms of development difficulty and performance is better than a single thread. Anyone who has used the current browser feels it is a headache to call a picture and wait. In Java, you can call an image by using a single thread, and you can access other information in HTML without waiting for it.

Dynamic

The dynamic feature of Java is the extension of its object-oriented design method. It allows programs to dynamically load the classes required during the running process, which is not implemented by Object-Oriented Programming in C ++. During the C ++ program design process, every time an instance variable or a member function is added to the class, all subclasses that reference the class must be re-compiled; otherwise, the program will crash. Java takes measures to solve this problem from the following aspects. The Java compiler does not compile the reference to instance variables and member functions as a numerical reference, but stores the symbolic reference information in the bytecode and passes it to the interpreter, after the interpreter completes the dynamic connection class, it converts the symbolic reference information into a numerical offset. In this way, an object generated in the memory is not determined during the compilation process, but is delayed to the runtime determined by the interpreter. In this way, the existing code will not be affected when the variables and methods in the class are updated. When interpreting and executing bytecode, the search and conversion process of such symbolic information is only performed once when a new name appears, and then the code can be executed at full speed. The advantage of determining reference during runtime is that you can use updated classes without worrying about affecting the original code. If a program is connected to a class in another system in the network, the owner of the class can update the class without causing any program that references the class to crash. Java also simplifies the use of an upgraded or brand-new protocol. If your system runs a Java program that does not know how to handle it, it doesn't matter. Java can automatically download the functional program you need.

Similarities and differences between C and C ++

Java provides all the functions of a powerful language, but has almost no mixed features. C ++ is not secure, but C and C ++ are accepted by everyone. Therefore, Java is designed in the form of C ++, which makes it easy for everyone to learn. Java removes many functions of the C ++ language, refined the functions of the Java language, and added some useful functions, java removes the following C and C ++ functions and features: pointer operation structure, typedefs, # define, and definition of global variables to be released in memory, these functions are prone to errors.

Java application overview web browsing

Web browsing is now the main way to use international networks and even local networks. The document can easily display text and various images. It also provides hypertext links. These browsers call documents written in the HTML language. The HTML/WWW browser technology is only applicable to text and images. If you want to play a sound or run a demo program, you have to download the file and use a program on your local machine that understands and runs the file format to play it. Java program and its browser hotjava provide methods for your browser to run the program. You can play the sound directly from your browser. You can also play animations on the page. Java also tells your browser how to process new types of files. When we can transmit video images online at 2400 baud, hotjava will be able to display these video frequencies.

Network Application System

Java is a platform-independent language. Therefore, network application systems developed using Java can run on various platforms, greatly increasing development efficiency and reducing repetitive work. Moreover, the network functions integrated with Java are fully beneficial to the development of network application systems.

Knot:

1. The emergence and prevalence of Java are objective requirements for Internet development today
2. Java is a programming language with good performance in all aspects, its basic features are simple, face object, distributed, interpreted, robust, secure, structure neutral, portable, outstanding performance, multi-thread, and dynamic. It is suitable for developing application systems on the Internet.
3. Java can create most network application systems, and it is well integrated with the popular WWW browser.

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.