preface

C: Hi, everyone! From this article, Teacher Cha will open a new column “Java Language Introduction”, this column will initially cover Java syntax, Java OOP, Java advanced features of three parts.

Of course, this kind of tutorial is too numerous to enumerate on the network. Teacher Cha also recommended everyone to read so-so and so-so articles in the past, but later found that these knowledge is scattered among the network, so dispersion is the first big problem; In addition, due to time and author factors, some contents have not been updated, which leads to a lag of knowledge.

Therefore, the purpose of Teacher Zha to open up this column is to continue to do a good job in the continuation and dissemination of knowledge update, the future of these content will continue to edit and update, just hope to let the younger generation in learning Java language can go smoothly, but also can take some detdetments in the early stage.

A series of reading

  • The Java syntax overview | Java”
  • The Java syntax | development environment set up”
  • The Java syntax | first Java program”

Program overview

All right, back to the point. From the moment you read this, you’ve opened the door to IT programming. From here on out, the word program may change the course of your future life. In the future, you will have a “perfect” program with high availability, high expansion and high security written by you, with the keys flowing smoothly, the CPU in your brain running at high speed and the screen switching between. [Future You]

First, let’s take a look at the concept of program. Program has two meanings in the modern age, that is, program in life and program in computer.

Life program

Routine: We’re all familiar with going to the bank, taking time off from school, or filing an expense claim at work. Over and over again, step by step, we follow the so-called procedures and procedures (routines). This is the routine of life.

A program in a computer

In this century, you might have changed the name of the actual process to: process or procedure. The concept of program, more often than not, has been put into the APP on your mobile phone, or QQ on your computer. They are programs, created by our future peers, our predecessors and the process of writing these programs is called programming.

Teacher Zha said: software is not a program, software is a larger concept than application program, software is a complete set of programs, data and related documents. Further reading: Software Engineering 4th Edition by Haifan Zhang and Yunxiang Lu

But this is a bit of a child’s play. The following [Baidu encyclopedia], the explanation is quite good! A program is really a collection of instructions.

What is a directive? For example: I am a boss (not yet), I have a female secretary (not yet), every day MY schedule or some tedious things are left to my secretary to do, I told the secretary to help me invite a guest, she did so. I told my secretary to inform me of the department meeting, and she did the same. In this example, what the boss tells the secretary is an order, and the secretary is the person who receives the order and carries it out.

Moving to the computer world, we call it a programmer/coder. If you want a computer secretary to do something like output something on the screen or automatically draw a Peppa Pig image, you have to give instructions to the computer. Learning to program is learning to give instructions to a computer secretary.

The relationship between program and program

From the above we understand the two meanings of the program, is there any relationship between them? In fact, the vast majority of computer programs are because of some processes/procedures in reality, it is very troublesome, time-consuming or produce some waste of resources (paper), so with the help of the computer, we humans will be in real life these programs, to the computer program performance. For example: online registration, online shopping, online course selection, OA system and so on.

This relationship can be explained in one sentence: our programming is to transplant the real life business procedures into the computer, in the form of computer instructions.

Programming Language Overview

Once we understand the concept of programs, how do we tell the computer about these program instructions? Verbally? Brainwave communication? Obviously not. So we write natural language to tell the computer what to do? Unfortunately, a computer can’t read it. It can only read binary. Early computer practitioners is knock at 0 1 to tell a computer what to do, but for us, it’s too tough a pile of 0110 to read, so later developing, we use the natural language defines some special syntax, again through a “translator” (compiler) to help us translation to computer, So that computers can execute our commands and we can read what we’re writing. The special syntax mentioned above is programming languages, also known as computer languages.

Major programming languages

There are so many programming languages that you can define their syntax. This is natural, as natural language is strange in today’s world. So we don’t need to pay too much attention to the “minor language”, just need to pay attention to the protagonist of today’s IT programming field. [see TIOBE]

The chart below shows the statistics of popular leaderboards, such as PYPL. TIOBE ranks are based on the number of experienced programmers, courses and third party vendors on the Internet, using search engines such as Google, Bing, Yahoo! And ranking data from Wikipedia, Amazon, and YouTube only reflect the popularity of a particular programming language, not how good a language is, or how much code it writes.

Teacher Zha said: In teacher Zha’s opinion, data can explain the quality or popularity of some languages. So far, even with some humility, we’re going to learn Java, which is still one of the hottest programming languages around. Even though there are some people on the Internet who are Shouting every day not to learn Java, to learn Python, to learn C, to learn PHP, and even heard that PHP is the best language, this kind of rhetoric.

Actually? Is there a perfect programming language? It’s just a different scenario, who fits better. And in today’s era, we only know one programming language can no longer adapt to the rapid iteration of Internet applications and enterprise needs (full stack). So not learning any programming language is a “false proposition” in itself.

Especially for those who have just stepped into the field of programming, Mr. Zha personally believes that Java is an extremely suitable language to start and make a living! It leads the way in terms of difficulty of understanding, syntax, performance, popularity, community support, business needs and popularity. Teacher Zha will tell you more about its history and ability later.

Java’s past and present

The birth of Java

Java is a high-level programming language introduced by SUN Microsystems in 1995. Here is one of the co-founders of Java: James Gosling. Gosling left SUN in 2009 when the company was acquired by Oracle. So far, Gosling has joined Amazon at AWS.

The image below shows the Logo of Java (a steaming cup of coffee, which is rumored to have been named after the coffee of Java, Indonesia). But how they looked like the thin hair on the heads of men.

In April 1991, the Green Project, led by Dr. James Gosling, was launched to develop an architecture that could run on a variety of consumer electronic products (set-top boxes, refrigerators, radios, etc.). The product of this project is the precursor to the Java language: Oak. Oak had little success in the consumer market at the time, but with the rise of the Internet in 1995, Oak quickly found its niche and morphed into the Java language. [1]

The development of Java

The graph below shows the evolution of Java, focusing on 1995, 1998, 2009 and mid-2013, to understand its history so that we can better “talk and partner” with it.

On May 23, 1995, the Oak language changed its name to Java, and Java version 1.0 was officially released at SunWorld. The slogan “Write Once,Run Anywhere” was first coined in the Java language.

On January 23, 1996, JDK 1.0 was released, giving the Java language its first official runtime environment. JDK 1.0 provides a Java Virtual machine implementation of pure interpreted execution (Sun Classic VM). Representative technologies of JDK 1.0 include: Java virtual machine, applets, AWT, etc.

On December 4, 1998, a landmark release of the JDK, JDK 1.2, was released under the project name Playground. In this release, Sun split the Java technology architecture into three directions, They are J2SE (Java 2 Platform,Standard Edition) for desktop application development, J2EE (Java 2 Platform,Enterprise Edition) for Enterprise development, and J2ME for mobile terminals such as mobile phones (Java 2 Platform,Micro Edition). In this version, there are many representative technologies, such as EJB, Java Plug-in, Java IDL, Swing, etc., and this version of Java virtual machine for the first Time built-in JIT (Just in Time) compiler (JDK 1.2 had existed three virtual machines, Classic VM, HotSpot VM, and Exact VM, which is only available on Solaris; The latter two VMS both have a built-in JIT compiler, whereas the Classic VM shipped with the previous version could only use the JIT compiler in a hung form.

On April 27, 1999, HotSpot virtual machine was released. HotSpot was originally developed by a small company called “Longview Technologies”, which was acquired by Sun in 1997 due to HotSpot’s excellent performance. The HotSpot VIRTUAL machine was released as an add-on to JDK 1.2 and has since become the default virtual machine for all Sun JDK versions 1.3 and later.

On February 19, 2009, JDK 1.7, code-named Dolphin, completed its first milestone release. Ten milestones were set according to the JDK 1.7 functionality plan. The final milestone release was scheduled to end on September 9, 2010, but for various reasons JDK 1.7 could not be completed as planned. During the development of the JDK 1.7, Sun’s stock market value dropped to only 3% of its peak value as the company was Mired in both technical and commercial competition, and it was unable to keep JDK 1.7 development on schedule. In an effort to end the long overdue JDK 1.7 issues, Oracle announced a “Plan B” shortly after the acquisition of Sun, significantly cutting the target JDK 1.7 targets so that the JDK 1.7 could be released on time on July 28, 2011. [1]

In November 2017, Oracle handed over Java EE (Java Enterprise Edition) to the Eclipse Foundation, and in March 2018 Eclipse renamed it Jakarta EE.

The ability of Java

Since the 1.2 version of 1998, Java has appeared in three versions of the direction, the above teacher zha also gave you a part of zhou’s book content. The three versions are: J2SE (Java 2 Platform,Standard Edition) for desktop applications, J2EE (Java 2 Platform,Enterprise Edition) for Enterprise development, and J2ME (Java 2) for mobile terminals such as mobile phones Platform, Micro Edition).

Java SE is the base core, and Java ME and Java EE are the two branches outside the core. No matter you want to learn Java ME or Java EE, you need to learn Java SE. The first three stages of our series of courses are to learn the basics of Java SE. In addition, our main branch in the future is Java EE, and our typical products are large-scale distributed applications such as Tmall and JINGdong. After further progress, we can also enter the hot field of big data. The well-known big data framework Hadoop in China is written in Java language, and many of the talents engaged in big data in China are former Java engineers.

It is also important to note that Java programs are cross-platform, meaning that Java programs can run on any platform and do not need to be compatible with different systems. “Write once, run anywhere.” We’ll explain this slogan and how it works later, after we write our first Java program.

Teacher Zha said:

  1. Due to the popularity of Windows, Microsoft’s C# language is more advantageous in the field of desktop program development, and C and C++ performance and rendering are more advantageous in game development. Java has almost no market.

  2. Java ME has been lost to Android and others. I wonder if you have ever used an old mobile phone like Nokia. Remember Java 2D games?

  3. Although Kotlin was officially supported by Google in 2017, Java is still the primary development language for Android. The reason is that Android has a lot of Java apis underneath it (read more about Oracle vs. Google).

Java is not only a programming language, but also a technical system formed by a series of computer software and specifications. This technical system provides a complete supporting environment for software development and cross-platform deployment, and is widely used in embedded systems, mobile terminals, enterprise servers, mainframes and other occasions. Today, the Java technology system has attracted more than 9 million software developers, the largest software development team in the world. Java is used by billions of devices, including more than 1.1 billion personal computers, 3 billion mobile phones and other handheld devices, numerous smart cards, and numerous set-top boxes, navigation systems and other devices. [1]

reference

[1] Zhou Zhiming. In-depth Understanding of Java Virtual Machine [M]. 3rd edition. Beijing: China Machine Press,2019

Afterword.

Teacher Zha said: For the learning of technology, teacher Zha has always followed the following steps: With a simple demo to let it run first, and then learn it the most commonly used API and configuration can let yourself up, finally, on the basis of proficiency in the spare time reading the source to try to make myself to be able to see clearly its running mechanism, part of the cause of the problem, at the same time, draw lessons from these technology to enhance your own code level.

So in the teacher’s article, the early basic are small white, only interspersed with a very small amount of source research. Of course, such as the small white update, you still like, the late will not regularly dedicated to part of the technology of the source code analysis.