Introduction to "Thinking in Java-chapter 1&&2" Objects && everything is an object

Source: Internet
Author: User

Java origins

It has been 11 years since the JDK was born. A moment of vicissitudes. 11 years later, the JDK has released 6 versions. Over the past 11 years, countless Java-related technologies and standards have been born. Now let's go into the time tunnel and go back to the 1995 and review the evolution and history of Java.

I. JDK pre-transmission

In this world, a lot of people familiar with Java history, if you want to ask a person when Java was born, perhaps most people will answer is 1995 (this is very good to remember, because Microsoft's WINDOWS95 also released this year). But in fact, Java began brewing in the early 90 of the last century.

In April 1991, the Green Project, led by Sun's James Gosling, began to develop a distributed system structure that would enable it to operate on a wide range of consumer electronics products. While members of the Green Project team started using the C + + language to complete the project, since the members of the Green Project group had a C + + background, they first looked at the C + + compiler, Gosling first rewritten the C + + compiler, but soon he felt a lot of C + + 's shortcomings, A new language needs to be developed to replace it, when the oak language was born.

After 17 months, the entire system was completed, the system is more focused on the set-top-box operating system, but at the time when the market is immature, their projects have not been successful, but Oak language has been the Sun President McNealy recognition.

Until the second half of 1994, due to the rapid development of the Internet and the rapid growth of global Information Network WWW, the first global information Network browser Mosaic was born; at this time, industry has a very urgent need for the language that is suitable for use in the heterogeneous environment of the network; games Gosling decided to change the direction of the green plan, and they made a small transformation of oak, so that Java was born on March 23 in 1995! The birth of Java marks the beginning of the Internet era, it can be applied to the global Information network platform to write interactive and strong applet program, and the 1995 applet will undoubtedly give people infinite visual and mental vibration. Let's call this piece of Java history a Java prequel.

In fact, the birth of Java quite so a "heart grow flowers flower not open, inadvertently inserted willow Willow into the yin" flavor. Just like UNIX and its predecessor, the Multics system.

Ii. early Childhood of the JDK (1995~1998)

After several years of research after the Sun's Green project, the Java and HotJava browsers were officially released on May 23, 1995 at Sunworld ' 95. In the same year, many companies acquired Java licenses, such as Netscape in August 1995, when Oracle acquired a Java license in October 1995. Following the release of the first Java version in 1995, Sun announced the creation of a new business unit, ──javasoft, in January 1996, which is responsible for developing, selling and supporting Java-based products, with Mr. Alanbaratz as president.

In 1995 Sun introduced Java, but this is only a language, and to develop complex applications, it must have a strong development library support is OK. As a result, Sun released its JDK1.0 on January 23, 1996. This version includes two parts: the runtime Environment (that is, the JRE) and the development environment (that is, the JDK). The operating environment includes core APIs, integration APIs, user interface APIs, publishing technologies, and five parts of the Java Virtual Machine (JVM). The development environment also includes compilers that compile Java programs (that is, Javac). In the JDK1.0 era, the JDK was not complete except for AWT, an API for developing graphical user interfaces.

Sun, following the launch of JDK1.0, was followed by Sun's release of JDK1.1 on February 18, 1997. JDK1.1 the biggest improvement over JDK1.0 is the addition of JIT (on-the-fly) compilers to the JVM. JIT and traditional compiler, the traditional compiler is to compile a piece, run out and then throw it away, and the JIT will be used to save the instructions in the content, the next call will not need to compile. This allows the JDK to have a significant increase in efficiency.

After the launch of JDK1.1, Sun then launched several jdk1.x versions. Since Sun launched Java, the JDK download volume continues to grow, in 1997, the JDK download volume exceeded 220,000, and in 1998, the JDK download volume has exceeded 2,000,000.

Although Java was adopted by many software companies before 1998, its application was limited due to the hardware environment and the technical reasons for the JVM. Java was primarily used in the front-end applets and in some mobile devices. However, this does not mean that Java applications are limited to these areas. In the 1998 was the beginning of the rapid development of Java a year. During the year, Sun released the Jsp/servlet, EJB specification, and the partitioning of Java into the EE, J2SE, and J2ME. Indicates that Java has sounded a clarion call to the enterprise, desktop and mobile 3 areas.

Introduction to CHAPTER 1 objects

As the Earth knows, Java is an object-oriented (OO) programming language.

Five basic features of a purely object-oriented programming approach:

    • All things are objects;
    • A program is a collection of objects;
    • Each object has its own storage composed of other objects;
    • Each object has its type;
    • All objects of a particular type can accept the same message.

All Java classes eventually inherit from a single base class;

An exception is an object that is "thrown" from the wrong place and is specifically designed to handle the corresponding exception handler "capture" of a particular type of error.

Concurrent programming

Java and the Internet

CHAPTER 2 Everything is "reference" in the object Java

It is like using the remote control (reference) to manipulate the TV (object), just hold the remote control, you can keep the connection with the TV. such as String S; But what is created here is just a reference, not an object, because it is not associated with anything (that is, there is no TV), so a safe approach is: String s= "asdf";.

Where are the objects that were created stored?
    1. Register: The fastest storage area, located inside the processor;
    2. Stack: In general-purpose RAM, there is a stack pointer, if move down to allocate new memory, upward release memory;
    3. Heap: Also located in RAM, for storing all Java objects (new)
    4. Constant storage: ROM;
    5. Non-RAM storage: Stream objects and persisted objects;
Arrays in Java

must be initialized;

Destruction of objects in Java

Determined by the scope, the Java garbage collector monitors new objects and automatically destroys them when they are no longer referenced.

Java Coding style: Hump style

The first letter of the class name is capitalized, and if the class name consists of several words, the first letter of each inner word is capitalized, and the initial letter of the identifier is lowercase.

Introduction to "Thinking in Java-chapter 1&&2" Objects && everything is an object

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.