Dark Horse programmer _ JavaSE learning summary 01st-day _ Java overview, _ javase_java

Source: Internet
Author: User
Tags clear screen

Dark Horse programmer _ JavaSE learning summary 01st-day _ Java overview, _ javase_java

------- Android training, java training, and hope to communicate with you! ----------

01.01 computer Overview

Computer: it is also known as a Computer.

It is a modern smart electronic device that can automatically and quickly process massive data according to the program running.

A computer composed of hardware and software that does not have any software installed is called a bare metal.

Common forms include desktop computers, laptops, and large computers.

01.02 overview of computer hardware and software

Computer Hardware refers to various physical devices in Computer systems, including electronic, mechanical, and Photoelectrical components.

These physical devices constitute an organic whole as required by the system structure to provide a material basis for the operation of computer software.

The computer is usually composed of multiple components, including CPU, motherboard, memory, power supply, memory box, hard disk, video card, keyboard, mouse, and display.

 

Computer software is essential to the use of computers. Computer software allows computers to complete specific functions in a predetermined order. Computer Software is divided into system software and application software according to its functions.

System software: DOS (Disk Operating System), Windows, Linux, Unix, Mac, Android, iOS

Application Software: office, QQ chat, YY language, mine clearance

01.03 software development and computer language Overview

Software: a set of computer data and commands organized in a specific order

Development: Software Production Process

Software Development: using development tools and computer languages to make software

Computer Language: a special language for communication between people and computers

There are also characters and symbols in computer languages.

Common computer languages such as C, C ++, C #, and JAVA

01.04 Human-Computer Interaction

The emergence of software enables better interaction between people and computers.

Interaction Mode

Graphical interface: This method is simple, intuitive, and easy to use.

Command Line Mode: a console is required to enter specific commands for the computer to complete some operations. This is troublesome. You need to record some commands.

01.05 keyboard function keys and shortcut keys

 

Function key

Tab: The positioning key of tabulation. Each press is generally equal to the length of 8 spaces.

Shift: The up key, hold down Shift, and then press the number key to enter the characters above the number key, or to switch between Chinese and English in the input method

Ctrl: it is usually used in combination with other buttons. It is called a shortcut key.

Alt: usually used in combination with other buttons

Enter: Enter the line feed key.

PrtSc (PrintScreen): Screen

Shortcut Key

Ctrl + A select Ctrl + C copy all

Ctrl + V paste Ctrl + X cut

Ctrl + Z cancel Ctrl + S save

01.06 how to open the DOS Console

1. Start → program → attachment → Command Prompt

2. Start → run → cmd → press Enter.

3. Shortcut: WIN + R → cmd → press Enter.

4. Press Shift on the desktop and right-click the system above Win7 → open the command window here

01.07 common doscommands

D: press Enter: The drive letter is switched to drive d.

Dir (directory): list files and folders in the current directory

Md (make directory): Creates a directory.

Rd (remove directory): deletes a directory.

Cd (change directory): change the specified directory (enter the specified directory)

Cd ..: Return to the upper-level directory

Cd \: Return to the root directory

Del (delete): delete a file. For example, delete a bunch of files with the same suffix *. txt, del *. txt.

Exit: exit the doscommand line.

Cls (clear screen): clear screen

01.08 extended doscommand

In addition to the directory, rd/s also deletes all subdirectories and files under the specified directory. Used to delete a directory tree.

Rd/q quiet mode. confirmation is not required when/S is used to delete the directory tree.

01.09 Java language Overview

Java Language Development History

1.0.2

1.1.1 → 1.1.6 → 1.1.7 → 1.1.8

1.2.1

1.2.2

1.3.0 → 1.3.1

1.4.0 → 1.4.1 → 1.4.2 → 1.5.0 (5.0) → 1.6.0 (6.0) → 1.7.0 (7.0)

Java platform version

1. J2SE (Java 2 Platform Standard Edition) Standard Edition

Is a solution for developing common desktop and business applications. This technical system is the basis of the other two and can complete the development of some desktop applications.

2. Small Edition of Java 2 Platform Micro Edition

Is a solution for developing electronic consumption products and embedded devices.

3. J2EE (Java 2 Platform Enterprise Edition) Enterprise Edition

It is a set of solutions for developing applications in an enterprise environment. The technologies included in this technical system include Servlet and Jsp, which are mainly used for Web application development.

After Java5.0, change the name to javase javame javaee.

01.10 principles of cross-platform Java

Cross-platform: applications written in Java can run on different system platforms.

Principle: you only need to install a java Virtual Machine (JVM Java Virtual Machine) on the operating system that runs the java application. JVM is responsible for running Java programs in this system.

 

01.11 JDK and JRE Overview

JRE (Java Runtime Environment java Runtime Environment)

Including the core class libraries required by Java Virtual Machine (JVM java Virtual Machine) and java programs. To run a developed Java program, you only need to install JRE on the computer.

JDK (Java Development Kit java Development Kit)

JDK is provided for java developers, including java development tools and JRE. Therefore, after JDK is installed, you do not need to install JRE separately. Development tools: compilation tool (javac.exe) Packaging tool (jar.exe) and so on

 

In short, the java program developed with JDK is handed over to JRE for running.

01.12 download JDK

Get JDK http://www.oracle.com from official website

Download different JDK versions for different operating systems

01.13 JDK Installation

Click Next. Suggestion: do not include Chinese characters or special characters such as spaces in the installation path. It is best to unify directories.

If you are prompted to install JRE, you can choose not to install it.

Verify whether the installation is successful: Enter the java or javac help information in the DOS window to indicate that the installation is successful.

01.14 uninstall JDK

1. Start → set → Control Panel → add or delete programs

2. Use professional tools (such as 360 software Manager)

01.15 introduction to Java Development Tools

Development tools: notepad, Notepad ++, Eclipse, and MyEclipse

01.16 write and run the first HelloWorld case

Procedure:

1. First define a class: class name

2. Add a pair of braces after the class definition :{}

3. Add a main (main) method/function in the braces: public static void main (String [] args ){}

4. Add an output statement in the braces of the main method: System. out. println ("hello world ");

5. Save the file as the class name. java

 

Compile and run:

1. Compile the program: javac Demo. java. After the statement is executed, the compiler starts to check the syntax of Demo. java. If no prompt is displayed, the syntax is correct and the Demo. class file is generated.

2. Run the program: java Demo. After the statement is executed, the virtual machine is started to load the Demo. class into the memory for running.

01.17 Summary of common issues during development

1. File Extension hiding causes compilation failure

2. class error: Class claas...

3. If the class name format is incorrect, try to enter it in English.

4. Incorrect matching of braces after the class name

5. The format of the main method is incorrect. public static void main (String [] args ){}

6. The Braces of the main method are missing.

7. The print statement is misspelled: System. out. println ("");

8. Incorrect quotation marks. The quotation marks must be Chinese full-width quotation marks.

01.18 configure the path environment variable

Role of path environment variable configuration

An external command javac is required for program execution, but the javac command can only be written to the bin directory under the JDK installation directory. However, during program development, the Source Code cannot be written to the JDK installation directory. Therefore, you need to save the source program to a specified directory in any location (recommended in English). Therefore, you need to make the javac Command run in any directory.

01.19 path environment variable configuration method 1

Windows 7, win8 system: Right-click desktop computer, select Properties, select Advanced System settings, select the Advanced tab, click environment variables, search for path in system variables below, and double-click path

XP system: Right-click desktop computer → select Properties → select Advanced Tab → click environment variable → search for path in system variables below → double-click path

Add the bin directory under the jdk installation directory to the leftmost and add a semicolon;

01.20 path environment variable configuration method 2

Go to the path environment variable reference configuration method 1

Create a new variable name: JAVA_HOME. Add the variable value: JDK installation directory for JAVA_HOME, for example, E: \ JAVAJDK \ Java \ jdk1.6.0 _ 45

Change the JDK directory in the path environment variable to % JAVA_HOME % \ bin, and % on both sides of % JAVA_HOME % indicates that JAVA_HOME is a variable.

The path environment variables are sequential.

 

When multiple JDK is installed in the system, you can use the javac-version command to view the current JDK version.

01.21 functions and configurations of classpath

Purpose: Enable the. class file in the classpath directory to run in any directory

Configuration: Create a new variable name: classpath. The value is set to the specified directory containing the class file. multiple directories are separated by semicolons (;).

 

1. If the classpath path is not set, an error is returned if the. class file is located in the current directory.

2. If the classpath path is set, the virtual machine searches for the. class file in the Set directory. If the path is not found, an error is returned.

For example, if set classpath = c: \ myclass, you can find the. class file in the c: \ myclass directory.

3. if the classpath path is added after the classpath is set, the virtual opportunity is searched under the Set directory. class file. If no virtual opportunity is found, search in the current directory. class file. If not found, an error is returned.

4. set multiple classpath paths, for example, set classpath =.; c: \ myclass. indicates the current path.

5. Add a new classpath path based on the existing one, for example, set classpath =.; % classpath %

Note: If the preceding settings are set in the DOS window, they are temporary settings. The DOS window closing settings disappear.

If the preceding settings are set permanently in the environment variables window

01.22 differences between path and classpath

The path environment variable records executable files, such as the. exe file. Find the executable files in the current path first. If not, find the files in the path environment variable.

The classpath environment variable records the directory where the java class runtime file is located.

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.