Learn Java from scratch - basics part01

Java Basics Part 1  

Today’s tasks:  

1. What is software development?

2. Human-computer interaction

3. Commonly used dos commands (understand)

4. What is a computer language?

5. Java’s three technical architectures (understand)

6. Java language features (cross-platform principle) (understand)

7. Java development environment construction (differences between JRE and JDK, downloading, installing JDK, and testing) (mastered)

8. Environment variable path configuration (permanent configuration, technical configuration, temporary configuration (understand)) (master)

9. Hello world writing (master)

study method:  

1) Cultivate the ability to think independently. If you really can’t solve the problem, ask your classmates and teachers.

2) Learn to organize notes by yourself. Remember not to use pen and paper. You can use word to organize them.

    3) When writing programs, you are required to: write comments; organize your own error document (exception document)

4) The most effective way to become a good programmer: knock, knock hard, knock hard 

5) Don’t turn the corner 

Summary: I hope everyone can achieve "Code has tortured me thousands of times, and I regard code as my first love."

1.Hardware and software  

Both hardware and software are components of a computer;

Question 1: What is hardware?

         d4c1c846ce98f1fc941a53ee50b9018c.png055c451788f03b382000781f61ede583.png    9d798662a8403d9952aa3c8585f96ea1.png 

Hardware: Hardware is equipment that is visible and tangible. Such as computer keyboard, mouse, monitor, etc...

1.1 What is software  

Official definition: A collection of computer data and instructions organized in a specific order.

In our daily life, we apply software to process data in computers.

1.1.1 What is an instruction?  

Instructions are commands. I want the software or tell the software to do something.

Combining these specific data and commands is software.

1.1.2 Software classification  

What are the common software? Mainly divided into two categories:

1. System software: refers to the operating system. Can interact with hardware.

89ca2e5747be00f4a9c9738c8f2048ef.png

For example: windows series; Linux (server); MAC (PC)

2. Application software: runs on system software to meet customer needs.

f0e9d7d3ae74a938416aba765f9e75a5.png

For example: qq; Baofengyingyin, 360, etc.

1.2 What is development --making software           

Development is about making software.

The actual development process of the enterprise:

aedce1ad35390698c608a63421135df6.png

2. Human-computer interaction  

The produced software runs on the operating system and is installed in the computer. That means that we are going to interact with computers through software, and then human-computer interaction is produced. Human-computer interaction is a way of interaction and a way of communication.

Human-computer interaction is actually the interaction process between people, application software, operating systems, and hardware.

There are two ways of expression of human-computer interaction: the first way of expression:

2.1 Graphical interface method:  

Graphical User Interface GUI

Features of the graphical interface method: This method is simple and intuitive, easy for users to accept, and easy to operate.

Graphical interface: It is currently the most popular way of human-computer dialogue.

2.2 Command line mode:  

Command Line Interface CLI: You need to have a console (DOS window) to enter specific instructions to let the computer complete some operations. Command means system command execution program.

Features of the command line method: It is more troublesome and needs to record some commands.

Command line operation method:

1. The console needs to be opened.

There are several ways to open the console (command line):

The first way: Windows Start-----"All Programs------"Accessories-----"Command Prompt.

   1)

     010986b9bfe7454528d8e11f03dd3d33.png

2)

19d412f0e2f28f31a3488aaf5ec00f7d.png

The second method: Windows start------》Search programs and files-----》Enter cmd in the search programs and files box------》Select cmd.exe and open it.

1)

ba6fa3552d8ae6fa533eb5f234e24cea.png

                da42434bb24848482419d9a9f9e82d0d.png

2)

bbb6ed511e3454d1697b17858f0b05f4.png

The third way: How to open the console in Windows: Windows key + R will appear the run window, enter cmd in the window to open the console (dos window).

1)

e1186b4de0c623d6f62d9b7ae362f2be.png

2. Enter specific commands: You cannot enter commands randomly in the console. The commands to be entered must be recognized by the operating system.

3. Only by entering the correct command will the operating system achieve the desired results.

The following is the opened console, command line window:

f7cae94feee152ce020b8452353ad321.png

b4431320beed2e78c4ab95985c658cc8.png

Directories are folders. subdirectory

2.3 The difference between graphical interface mode and command line mode  

The graphical interface is simpler and more intuitive, and only requires operation, while the command line method is a bit troublesome. The commands are complicated and difficult to remember. You must remember some fixed commands to operate. If you don’t remember the commands, you cannot operate.

3. Commonly used dos commands (understand)  

Note: When operating in the command line, you only need to remember one command (word), -----》help

   help: it can list all dos commands in windows

   help specific command means you can view the specific usage of the current command2e03fc86f0539ddc29b6f2c6190d06b6.png

60bc9fb4d57a57bcf117931b9b42c939.png

dir: is the abbreviation of directory. Indicates displaying files and subdirectories (folders) in a directory.

For example: List the directories under the e drive: Enter the e drive -------》dir

cd: Display the name of the current directory or change it.

Case:

1) Enter the e drive: e:

2) Display the name of the current directory: cd

3) To enter a folder in the e drive, you need to use cd change directory  

For example: cd java to enter the java directory

4) Return to the previous directory: cd ..    

For example: e:/java/a exit directory a cd.. return to e:/java       

5) Return directly to the root directory: cd \. Note that / is called a slash and \ is called a backslash.

The difference between / and \:

The UNIX operating system designed this method of path separation using slashes: /. Since the network was first used between UNIX computers, so far, more than half of the network servers still use the UNIX operating system, so URLs also use slashes as path separators.          
         
When Microsoft developed DOS 2.0, it borrowed this directory structure from UNIX. However, since in DOS, slashes were already used as command line parameter markers (the "-" character was used in UNIX), so they had to use Backslash: \          
         
In the Windows era, there is often no interference from command line parameters, and with the expansion of network use, slashes and backslashes can now be interchanged most of the time without any impact.

cls: clear screen

Exit: Exit the CMD.EXE program.

Start: Open a separate window to run the specified program or command. Just reopen a new dos window.

Copy the text in dos: right click----->Mark------>press Enter.

Tips in Dos:

The up and down keys on the keyboard can turn pages of previously entered dos commands.

Summary: The conclusion is that when you double-click and no graphical interface appears, then it is the command line method. If   it is a command line method, you must first open the command prompt (DOS window or console).             

4. What is a computer language?  

Through the above demonstration of dos commands, we can make the computer do something we want to do by entering some commands. In fact, I can also call those commands computer language. If we humans want to interact and communicate with computers, then we must master computer-related terminology.

Through the demonstration of the DOS command line, I found that entering and executing specific commands is just like talking to the computer.

What we tell it to do, it does. The premise is that it must recognize what we say to it. This is computer language.

4.1 What is language  

In real life, communication between people requires language. But if you really want to communicate, the language you use must ensure that both parties can recognize it.

Language: a communication tool for both parties.

4.2 What is a computer language?  

Computer language is a way of interaction between humans and computers.

Similar to human language, there are hundreds of human languages.

Then there are many kinds of computer languages,

Most common computer languages:

4.3. Introduction to Java language  

JAVA is a high-level programming language launched by SUN (Stanford University Network) in 1995. The founder is James Gosling, who is called the father of Java in the industry.

07204c2d632a902de169ecac76e90ca8.png

Java is an Internet-oriented programming language.

In 1982, Sun Microsystems was born on the campus of Stanford University in the United States. Sun was listed in 1986, and its logo on NASDAQ (Nasdaq, which is the National Association of Securities Dealers automatic quotation system) is SUNW. In 2007, it was changed to JAVA.

At 19:40 on April 20, 2009, American data software giant Oracle announced its acquisition of Sun Microsystems for US$7.4 billion.

As Java technology continues to mature in the web, JAVA has become the preferred development language for web applications.

As the Internet continues to rise, and the Java language happens to be a programming language oriented to the Internet, Java has become more and more popular, and it is still very popular today.

A programming language that is easy to learn, completely object-oriented, safe, reliable, and platform-independent.

5. Java’s three technical architectures (understand)  

Java language provides three technical methods for development direction, that is, three architectural directions. Different architectures can be applied to different fields.

J2SE: Standard Edition, which can develop ordinary desktop applications (application software), the standard of Java language, and the basis for learning Java. For example: feiq, minesweeper, poker, etc.

J2EE: Enterprise Edition is enterprise-level development, mainly for enterprises and aimed at the development of web applications.

J2ME: Small version, mainly used for developing electronic consumer products. Such as the applications in mobile phones, which have now been replaced by Android.

Java version issue:

After Java5:

J2SE:JAVASE

J2EE:JAVAEE

J2ME:JAVAME

6.Java language features (cross-platform principle) (understand)  

Some features of Java:

1. Open source, free, you can see how Java is written.

2. Cross-platform, software developed using Java applications can run on any platform.

6.1. What is cross-platform?  

Platform: It can refer to many aspects, such as professional platform, which here refers to the operating system.

Cross-platform:

Programs or software written in Java can run not only on windows, but also on Linux and mac. This means that they can run on any operating system.

6.2 Cross-platform principle  

Java cross-platform principle:

All programs developed in Java can run on any operating system, mainly because different software (Java virtual machines) are installed on different operating systems. Jvm (Java Virtual Machine)

fddc6f4a55118a87de4d313e66edca85.png

Summary: If a Java program wants to run on the operating system, it must use a piece of software, the jvm virtual machine.

Different operating systems correspond to different versions of jvm.

7. Java development environment construction (mastery)  

No matter what language is used for development in the future, the first step is to have an environment. Without the environment, we cannot run the program. So now that we know that Java programs run on the operating system, they must first pass the jvm virtual machine, then we must first Install the relevant environment for running Java, that is, jvm.

Before setting up the environment, we must first understand two concepts: JRE and JDK.

7.1What is jre  

The full English name of Jre is: Java Runtime Environment Java runtime environment.

The full English name of Jvm is: Java Virtual Machine java virtual machine. It is the core, but to run a Java program, the core may not be enough. It also needs some related core auxiliary tools. We call these auxiliary tools core class libraries, which store the most basic and core content needed by the program.

So jre is composed of jvm and core class library.

Jre=jvm (virtual machine) + core class library.

Now with jre, we can run Java programs on the computer.

But when we learn Java, we don’t want to run it, we want to develop it.

Summary: jre is only responsible for running Java programs.

2050378e507b5c37a8f0e85fe7fcda79.png

7.2 What is jdk  

For example: If you want to play games, jre is enough. If you want to make games, you must install jdk.

Jre only runs Java programs, so if we want to develop, we need development-related tools.

Jdk (Java Development Kit): java development tool kit.

jdk is provided for Java developers to use. The programs we develop using jdk must be run by jre.

Note: Actually, jdk also includes jre.

Jdk=development kit+jre (jvm+core class library).

67b70ce1c4f104f4666f2e890b377d0b.png

Conclusion: So after installing jdk, we don’t need to install jre.

7.3 Download jdk (refer to jdk download document)  

Official website: www.oracle.com. Go to the official website to download jdk.

Refer to the JDK download steps.doc document

c8c92c855c814d94fe2b73555553c642.png

7.4 JDK installation and testing  

Refer to the Java development environment JDK installation .doc document

39119ce89d978af4c328245849e73b06.png

Guess you like

Origin blog.csdn.net/weixin_45737584/article/details/130787901