Darnay Java big data learning - the first day

Keywords: Java Big Data

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

QQ screenshotCTRL+ALT+A
Select allCTRL+A
Anti revocationCTRL+Y

Common DOS commands

DOS commandCommand function
Drive letter +:Switch to the specified drive letter
dirView all sub files and subdirectories in the current directory, which is the abbreviation of directory
cdEnter directory
cd .Access current directory
cd ..Back to the upper directory
cd /Back to root
clsClear screen is short for clear screen
exitExit DOS command line
mkdirNew directory folder
rmdirTo delete a directory, the directory to be deleted must be empty
delDelete file
notepadOpen Notepad
calcOpen calculator is the abbreviation of calculator
mspaintOpen drawing

JDK installation and configuration of environment variables

  1. Use JDK1.8

  2. 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

  3. Directory introduction

    • bin --- executable file

    • JRE -- runtime environment JRE

    • lib -- third party jar package

    • src -- source package

  4. 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


    • 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

  1. 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

  2. Create project: flie---new---project---Java---Java project --- create project name --- finish

  3. 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

  4. 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!!!");

Posted by aidude111 on Tue, 30 Nov 2021 04:48:31 -0800