Danemu course Network
website: www.tmooc.cn
Account No.: qq email
Password: the last four digits of ID card + the last four digits of mobile phone
Computer function keys and shortcut keys
function | instructions |
---|---|
Screenshot | PrtSc |
QQ screenshot | CTRL+ALT+A |
Select all | CTRL+A |
copy | CTRL+C |
paste | CTRL+V |
shear | CTRL+X |
revoke | CTRL+Z |
Anti revocation | CTRL+Y |
preservation | CTRL+S |
Common DOS commands
DOS command | Command function |
---|---|
Drive letter +: | Switch to the specified drive letter |
dir | View all sub files and subdirectories in the current directory, which is the abbreviation of directory |
cd | Enter directory |
cd . | Access current directory |
cd .. | Back to the upper directory |
cd / | Back to root |
cls | Clear screen is short for clear screen |
exit | Exit DOS command line |
mkdir | New directory folder |
rmdir | To delete a directory, the directory to be deleted must be empty |
del | Delete file |
notepad | Open Notepad |
calc | Open calculator is the abbreviation of calculator |
mspaint | Open drawing |
JDK installation and configuration of environment variables
-
Use JDK1.8
-
matters needing attention:
-
When installing multiple jdks at the same time, you need to use the execution environment variable to confirm which JDK is used
-
Note that the installation path should not have Chinese or special symbols, such as spaces, etc. it is best to have a unified directory
-
-
Directory introduction
-
bin --- executable file
-
JRE -- runtime environment JRE
-
lib -- third party jar package
-
src -- source package
-
-
Configuration and inspection of environment variables
-
My computer - properties - advanced system configuration - environment variables - system variables
-
New variable name: JAVA_HOME variable value: the upper layer of bin directory in Java, such as C: \ program files \ Java \ jdk1.8.0_ one hundred and eighty-one
-
New variable name: CLASSPATH variable value: lib directory of Java, such as C:\Program Files\Java\jdk1.8.0_181\lib
-
Find the Path environment variable and click Edit add / new variable value: bin directory of Java, such as C:\Program Files\Java\jdk1.8.0_181\bin
-
Check whether the configuration is successful. Enter "cmd" in the "win+r" pop-up window. Enter "Java -version" in the pop-up window. The configuration is successful when the version number is displayed
-
Eclipse
-
-
Note: Eclipse does not need to be installed. It can be used after decompression. For the convenience of subsequent use, open the extracted eclipse folder, select the eclipse.exe file, and create a shortcut on the desktop
-
Note: the decompression path of Eclipse should not have Chinese or special symbols, such as spaces.
-
We need to install a lot of software in the future. It is best to have a unified directory, such as D:/software/eclipse
-
-
How to use eclipse
-
Workspace settings:
The workspace is a folder used to save all our development files and code. The workspace can also be switched, but after switching the workspace, our eclipse settings are reset. The subsequent code we write can be found in this location. You can select the storage directory of the workspace as shown in the figure below
-
Open package view:
The package view is set for development convenience
Window---Show View---package Explorer
Or Window---Show View---Other... --- search package Explorer -- check to confirm
-
-
Create project: flie---new---project---Java---Java project --- create project name --- finish
-
Create package: define the package name in the created project src file --- new---package. The package name is all lowercase, and the company domain name is written upside down
-
Create a Java class: define the class name in the built package --- new---class. Class name: hump naming method. The first letter of each word should be capitalized
Hello World case study
package cn.tedu.hello; /** * package---package *cn.tedu.hello---Package name, all lowercase, company domain name written upside down *; Java Statement Terminator *Note: all symbols in Java code are English symbols */ //Save code: CTRL+S Execution code: CTRL+F11/CTRL+Fn+F11 /** * public--Public, as a class modifier, modifies that everyone can access this class * class--Class, a special word used by Java to define a class * HelloWorld--Class name: hump nomenclature, the first letter of each word should be capitalized * {}: Represents the main content of the class, and the code we write is here * */ public class HelloWorld { //Write a main, then ALT + / completion shortcut /** * public static void main(String[] args) {}:Entry function, program entry * public -- Public. As the modifier of the method function main, it modifies that everyone can access this entry function * static -- Static * void -- Method, indicating null * main -- Method name * () -- Represents that this is a method function * String[] args --Parameter type and parameter name of method * */ public static void main(String[] args) { //Write a syso and complete it with ALT + / shortcut /** * The function of this sentence is to output a sentence to the console * system -- System means that we are about to issue a system instruction * out -- Outward output * println -- The specific output method is line feed after printing * print -- Specific output mode: no line break after printing * () -- This is a method * "Hello World!" -- What we want to output * ; -- Indicates the terminator * */ System.out.println("Welcome to Java World, lovely programmers~"); System.out.println("Hello World !"); System.out.print("Hello World !"); System.out.print("He doesn't change his career!!!"); System.out.print("Hello World !"); System.out.print("He doesn't change his career!!!"); } }