Java Learning Summary-Your past life

Source: Internet
Author: User

I. Background

The Java language was at the very beginning of an internal project that Sun Microsystems began to study in December 1990.

A project teacher named Patrick Norton, a Sun computer company, was overwhelmed by the company's own C + + and C-language compilers , because the APIs were extremely difficult to use . Patrick decided to switch to next. At the same time 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 a very large number of members, including Sun's chief scientist Bill Joey, found that C + + and the available APIs had some very big problems.
The Working Group uses an inline type platform. The resources available are extremely limited.

Very many members found that C + + was too complex to be used incorrectly by many developers. They found that C + + lacked a garbage collection system, as well as portable security, distributed programming, and multithreading capabilities. last. They want a platform that is easy to port on 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 project division should develop an object-oriented environment based on C + +. Initially, Gosling attempted to modify and extend the functionality of C + +. He himself called the new language C + + +--but then he gave it 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, later renamed to HotJava. Same. Oak renamed Java. Trademark Search display. Oak has been registered by a graphics card manufacturer. So the team found a new name.

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

In October 1994, HotJava and the Java platform demonstrated to the top of the company. 1994. The Java 1.0a version number is already available to download. But the first public announcement 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 a startling announcement by Mark Anderson, vice president of Netscape, announcing that Netscape would include support for Java in its browser. January 1996. Sun founded the Java Business group, specializing in the development of Java technology.

Second, development 1. Concept

is an object-oriented programming language capable of composing cross-platform application software.

Java differs from the general compilation language and literal translation language. It first compiles the source code into bytecode. It then relies on virtual machines on various platforms to interpret the execution bytecode, thus enabling " write Once." the cross-platform feature that executes 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

Java programming language. That is, syntax.

Java file format. That is, the suffix of the various directories and files.


The Java Virtual machine (JVM), the interpreter that processes the *.class file.
Java Application Interface (Java API).

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

It has simple, object-oriented, stable. Platform-Independent. Explanatory, multi-threading, dynamic and other features.

(2) Simple

The simple Java language means that the language is easy to learn and useful.

Assuming that you have learned the C + + language, you will feel Java very familiar, because many of the basic syntax in Java and C + +, like the regular use of looping statements. Control statements and so on almost the same as C + +, but do not misunderstand that Java is an 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. The hypothesis is based on the simplicity of the language. Java is simpler than C + +. A lot of easy confusing concepts in C + +. or discarded by Java, or 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 tap code . in real life, we are dealing with objects every moment of the day.

We are able to give a concept, such as a motor vehicle, with properties and functions that we collectively own.

A detailed sedan is an instance object of a motor vehicle class.

The Java language, like other object-oriented languages, introduces the concept of classes, which are templates used to create objects, including the state-descriptive narrative 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 that can cause programs to fail or fail to execute. Java's virtual machines have succeeded in overcoming this problem. The Java-written program was able to execute correctly on any computer where the Java Virtual machine JVM was installed, and Sun realized its own goal " once written." Execution everywhere . "

(5) explanatory type

We know that languages such as c,c++ are only capable of compiling specific CPU chips and generating machine code. The execution of the code is related to a specific 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 very close to the machine code and is interpreted to run on whatever system that provides the Java virtual machine JVM.

Java bytecode is carefully designed, very easy to use JIT compile-time compiler technology to directly convert bytecode into high-performance local machine code. In the Java 2 release, Sun has provided such a bytecode compiler--jit (Just in time), which is part of the Java Virtual machine. The Java execution system still has platform independence at the same time that it provides JIT, so "efficient and cross-platform" is no longer contradictory to Java.

Suppose the Java program is better than "Chinese". Bytecode is the equivalent of Esperanto. Esperanto is not and detailed "state", only to this "country" provides "translation." will be able to translate Esperanto into local languages at high speed .


(6) multithreading

One of the features of Java is the built-in support for multithreading . Multithreading agrees to complete multiple tasks at the same time. In fact, multithreading gives the illusion that multiple tasks run at the same time, because the processor of the current computer can only run one thread at a time, but the processor can switch between different threads at high speed. Because the processor is very fast. Far more than the speed at which people receive information, so it feels as if multiple tasks are running 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 concern is that the program contains malicious code, such as trying to read or delete some key files on the local machine, even the program is a virus program. When you use Java-enabled browsers, you can safely execute Java applet Java applets. Without worrying about virus infections and malicious attempts, Java applets will be restricted in the Java execution Environment, not agreeing to access other parts of the computer .


(8) dynamic

The basic components of a Java program are classes, and some classes are written by themselves. Some are introduced from the class library. and classes are dynamically loaded at execution time, which allows Java to dynamically maintain programs and class libraries in a distributed environment , unlike C + +, where the corresponding program must be changed once the class library is upgraded. Compile.

4. Disadvantages

long development cycle, large code size. High technical requirements for procedural apes

It is said that for a large project, it may take 9 months to use Java, and it may be necessary to read more than 10 books, but if you use Ruby for 3 months, 3 books will suffice. and. NET is just 3, 4 books enough. That's the difference.

Compared to performance, Microsoft has done a sample. is the same project with Java and. NET, the result development cycle.. NET is half of Java, and the code size Java is three times times that of. Net.

Three, comparative

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 features such as easy-to-use pointers in the C language (in lieu of references), operator overloading (operator overloading), multiple inheritance (in the interface), and so on. The garbage collector feature has been added to reclaim memory space occupied by objects that are no longer referenced, leaving the program apes no longer worried about memory management.

In the Java 1.5 version number, Java introduced language features such as generic programming (Generic programming), type-safe enumeration , indefinite length of arguments, and self- loading/unpacking .


Summary: regardless of Java or. Net. They are all a kind of programming language. the key to programming is not language, but thought . Once you have thought, the program you make up has a soul, no matter what the language to your hand will be your tool, their value is to help you achieve the goal as soon as possible. But suppose you don't have a mind. It was like sailing in the sea lost the sail, it was very difficult to hit the sea and one side. So. Let us learn the ideas of language, let us 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.