Java Learning Summary-Your past life

Source: Internet
Author: User

I. Background

The Java language began as an internal project that Sun Computer (Sun Microsystems) began to study in December 1990. A company named Patrick Norton, an engineer at Sun Computers, wasSelf-developed C + + and C-language compilers are making a mess, because one of theAPI is extremely difficult to use。 Patrick decided to switch to next, and he was given the opportunity to study a project called the Stealth program.
In this project, the team initially considered using the C + + language, but many members, including Sun's chief scientist Bill Joey, foundC + + and the APIs available are a big problem in some ways.
The Working Group uses an embedded type platform, which can be used with very limited resources. Many members foundC + + is so complex that many developers often use it incorrectly. They found that C + + lacked a garbage collection system, as well as portable security, distributed programming, and multithreading capabilities. Finally, they want a platform that is easily ported to a variety of devices.
Based on available funds, Joey decided to develop a new language for the C and Mesa languages, and in a report that Joey called "The Future," he suggested that Sun's engineers should develop an object-oriented environment based on C + +. Initially, Gosling tried to modify and extend the functionality of C + +, which he himself called the new language C + +--but later he gave up. He is about to create a new language, named "Oak" by him, named after the Oak tree outside his office.
In July 1994, after a three-day brainstorming session, John Guegy, James Goslin, Bill Joy, Patrick Norton, Wehn Ross and Eric Scout Rice, the team decided to change the goal of the effort once again, and this time they decided to apply the technology to the World Wide Web. As a prototype, Patrick Norton wrote a small web browser, Webrunner, and later renamed HotJava. In the same year, Oak was renamed Java. The trademark search showed that oak had been registered with a graphics card manufacturer, so the team found a new name.

The name was coined in a local café frequented by many members. A more plausible argument is that the name is for coffee, so it's named after Java coffee. The first four bytes of a class file, if read in hexadecimal, are "CA FE BA be" and spell out two words "Cafe BABE" (Coffee baby).

In October 1994, HotJava and the Java platform demonstrated to the top of the company. The Java 1.0a version was available for download in 1994, but the first public release of Java and HotJava browser took place at the Sunworld conference on May 23, 1995. Sun's scientific guidance John Guegy announces Java technology. The announcement was made in conjunction with the astonishing release of Mark Anderson, executive vice president of Netscape, announcing that Netscape would include support for Java in its browser. In January 1996, Sun founded the Java Business Group, which specializes in Java technology.

Second, development 1. Concept

is an object-oriented programming language that can compose cross-platform application software.

Java differs from the general compilation language and literal translation language. It first compiles the source code into bytecode, and then relies on the virtual machines on various platforms to interpret the execution bytecode, thus achieving the cross-platform feature of " write once, run everywhere ".

The Java programming language is a simple, object-oriented, distributed, explanatory, robust, secure and system-independent, portable, high-performance, multi-threaded, and dynamic language .

2. Composition

The Java programming language, or syntax.

Java file format, which is the suffix of various folders and files.
The Java Virtual machine (JVM), the interpreter that processes the *.class file.
Java Application Interface (Java API).

3. Advantages (1) Java is currently one of the most widely used network programming languages.

It has simple, object-oriented, stable, platform-independent, interpretive, multi-threading, dynamic and other characteristics.

(2) Simple

The simple Java language means that the language is easy to learn and useful. If you have learned the C + + language, you will feel Java is familiar, because the syntax of many basic statements in Java and C + +, like the usual loop statements, control statements and so on, and C + + almost the same, but do not misunderstand that Java is the enhanced version of C + +,Java and C + + are two completely different languages, they each have their own advantages , will be long-term coexistence, the Java language and C + + language has become the language that software developers should master. If you look at the simplicity of the language, Java is simpler than C + +, many confusing concepts in C + +, either discarded by Java, or implemented in a clearer and easier-to-understand way, for example, Java no longer has the concept of pointers.

(3) Object- oriented

Object-based programming is more consistent with people's thinking patterns, making it easier for people to write programs . in real life, we are dealing with objects every moment of the day. We can use common attributes and functions to give a concept, such as a motor vehicle class. A specific sedan is an instance object of a motor vehicle class.

The Java language, like other object-oriented languages, introduces the concept of a class, which is the template used to create an object that contains the state description of the object being created and the definition of the method.

(4) platform- Independent

Cross-platform is the biggest advantage of the Java language. A major problem with programs written in other languages is the changes in operating systems, processor upgrades, and changes in core system resources, which can cause programs to fail or run out of control. Java's virtual machine successfully solves this problem, and Java-written programs can run correctly on any computer where the Java Virtual machine JVM is installed, and Sun realizes its own goal , "write once, run everywhere ."

(5) explanatory type

We know that languages such as c,c++ can only be compiled for a particular CPU chip, generate machine code, and the code runs on a particular cup.

Java, unlike C + +, does not compile for a particular CPU chip, but instead compiles the program into an "intermediate code" called bytecode. Bytecode is a file that is close to the machine code and can be interpreted on any system that provides a Java virtual machine JVM.

Java bytecode has been carefully designed to make it easy to use JIT-on-the-fly compilation techniques to translate bytecode directly into high-performance local machine code, which is provided by Sun in the Java 2 release with such a bytecode compiler--jit (Just in time), It is part of a Java virtual machine. The Java runtime system is still platform independent while providing JIT, so "efficient and cross-platform" is no longer contradictory to Java.

if the Java program than do "Chinese", bytecode is the equivalent of "Esperanto", Esperanto is not and specific "state", as long as the "country" provides "translation", you can quickly translate Esperanto into local language .

(6) multithreading

One of the features of Java is the built-in support for multithreading . Multithreading allows multiple tasks to be completed at the same time. In fact, multithreading makes the illusion that multiple tasks are performed simultaneously, because the processor of the current computer can only execute one thread at a time, but the processor can switch quickly between different threads, because the processor is very fast, far more than the speed at which people receive information, So it feels like multiple tasks are executing at the same time. C + + does not have a built-in multithreading mechanism, so you must invoke the multithreaded capabilities of the operating system to design multi- threaded threads.

(7) safety

When you are ready to download a program from the network, your biggest worry is that the program contains malicious code, such as trying to read or delete some important files on the local machine, or even the program is a virus program. When you use a Java-enabled browser, you can safely run Java applet Java applets without worrying about virus infection and malicious attempts, and Java applets will be restricted to the Java runtime and not allow it to access other parts of the computer .

(8) dynamic

The basic components of a Java program are classes, some classes are written by themselves, some are introduced from the class library, and classes are dynamically loaded at runtime, which allows Java to dynamically maintain programs and class libraries in a distributed environment , unlike C + +, whenever its class library is upgraded, The corresponding program must be re-modified, compiled.

4. Disadvantages

long development cycle, large code size, high technical requirements for programmers

It is said that for a large project, if you use Java, it may take 9 months, and may need to read more than 10 books, but if you use Ruby, 3 months, 3 books is enough, and. NET is only 3, 4 books enough, this is the difference.

than performance, Microsoft has done one example, is the same project with Java and. NET, the result development cycle,. NET is half of Java, the code amount of Java is three times times. Net.

Third, Comparison

The Java programming language is very close to the C language and C + + language.

Java is a purely object-oriented programming language that inherits the core of the object-oriented technology of C + + language. Java discards the attributes of C that are prone to errors (by reference substitution), operator overloading (operator overloading), multiple inheritance (replaced with interfaces), and more The garbage collector feature , which reclaims memory space occupied by objects that are no longer referenced, allows programmers to no longer worry about memory management.

In Java version 1.5, Java introduced language features such as generic programming (Generic programming), type-safe enumeration , variable-length parameters , and self - loading/unpacking .


Summary: whether Java or. Net, they are a programming language, the key to programming is not language, but thought , once you have the idea, then you make up the program has a soul, no matter what language into your hand will be your tool, Their value is to help you achieve your desired goals as quickly as possible. But if you don't have a mind, it's like sailing in the sea loses its sail, it's hard to hit the other side of the sea. So let's learn the ideas in the language and let's master the Soul of programming.


Java Learning Summary-Your past life

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.