Basic overview of the java language

The development of computer languages

  1. Overview of programming language: It is a language that uses specific symbols, specific formats, and completes the logical design of software. Computer language is a special language for communication between people and computers.

  2. Classification of programming languages:
    ​ A. Machine language: Machine language has only two symbols, 0 and 1, and uses a special combination of 0 and 1 to complete special instructions. The readability of this language is extremely poor and requires professionals to read it. I understand, the bad part: poor
    readability , not many instructions, but the advantage
    : very efficient You can combine various instructions and specify a special format. They are all English instructions, but they are much more than assembly language. What are the high-level languages: C, Java, C++, C#, Python, Go, etc.


Introduction to java language

  1. The iterative update of the Java version, the java language itself is also a software, the software means to be updated, the purpose is to make the java language more excellent.

The earliest version of
Jdk1.0 Jdk1.1 Jdk1.2 joined
the collection system Java7 This version is mainly used to teach Java8 to make relatively big changes: Lambda expression, functional interface, StreamingAPI (teaching version) Java9 Java10 Java11 The latest java version 3. Java development support platform Different versions: different Development direction JavaME: The smallest development platform, mainly used to develop mobile applications JavaSE: Standard platform, can be used for PC-side programs JavaEE: Enterprise-level development, used to develop website server services











java cross platform

  1. JVM: java virtual machine java vertual machine, used to provide an executable environment for java

  2. JVM cross-platform diagram:
    insert image description here

    Schematic
  3. JRE: java runtime environment java runtime environment, provides some frameworks and system classes that java depends on in the runtime environment

  4. JDK: java developer toolkit java development kit The toolkit to use when developing java, which contains jre and jvm

  5. The relationship between JDK, JRE, and JVM:
    insert image description here


command line interaction

  1. Interaction refers to the way to communicate with the computer

  2. What are the commonly used computer interaction methods:
    graphical interaction
    ​ voice interaction
    ​ somatosensory interaction
    ​ face recognition
    ​ touch interaction
    Ancient times: using command line interaction: command interaction is the fastest interaction method, the above interaction methods are the final It will be transformed into the way of command interaction and communicate with the computer.

  3. Common operating instructions
    for command line interaction How to use command line interaction and open the command line interaction window:
    A. Press wins+r to enter cmd (enter) (commonly used to open)
    B. Start→All Programs→Accessories—Command Prompt character (rarely used)
    C. Enter a folder, hold down shift+right mouse button -> select "Open command line window here"

  4. Common command line commands: switch drive letter: drive letter name: carriage return drive letter name is not case sensitive

  5. Often see sub-files and sub-folders command: dir
    enter a folder command: cd directory name
    cd . Return to the current directory
    cd... return to the previous directory
    ​cd / or \ Return to the drive letter root directory
    to create a folder command: mkdir Folder name
    Command to delete a folder: rd Folder name
    You can delete an empty folder directly, but you cannot delete a non-empty folder directly
    ​rd /s Add /s to the folder name to delete a non-empty folder
    Create a file and write Input content: echo content >> file name
    ​ echo output function
    ​ >> pipe symbol
    Call software to open the file: software name file name
    notepad *.txt
    Delete file: del file name
    del *. suffix delete all the names of the specified suffix file, * matches any filename


HelloWorld case:

Java program development process:

  1. Edit and write the java code yourself, it will generate a *.java source file
  2. To compile, use the javac command under jdk to compile *.java into a *.class bytecode file
  3. Run the java command under jdk, run the *.class file but do not add the .class suffix at runtime
  4. Debugging yourself finds a problem with your own code, and solves the problem is called debugging.
  5. Steps to implement the HelloWorld case:
    ​ Create a HelloWorld.java file under the bin file of jdk
    ​ Code example:
public class HelloWorld{
    
    
      //定义主方法
       public static void main(String[] args){
    
    
      //输出字符串HelloWorld
             System.out.println("HelloWorld");    
           
       }
}  

The console shows: HelloWorld
code runs:

insert image description here


HelloWorld common errors and code specifications
  1. file not found
  2. The file name is wrong, java is strictly case sensitive
  3. The file suffix is ​​not displayed, and the file suffix is ​​called out
  4. .java and javac instructions, "not content or external instructions":
    the first method must create the java file in the bin directory of the jdk The
    second method: configure the environment variables, so that the executable in the bin directory of our jdk The program can be executed anywhere under Windows
  5. misspelled word
  6. word case
  7. Braces and parentheses do not appear in pairs, you must pay attention when writing code, and you must write the parentheses in pairs
  8. A. When writing java code, you must abide by some specifications. These specifications are a set of standards . B. When
    writing curly brackets, a space is reserved in front of them
    .
    The right side of the parentheses must be aligned with the starting position of the line where the opening braces are located
    . E. Spaces are habitually added to both sides of the operator.
    F. Between different code blocks, a newline should be added
    . G. To write class names, use both Big camel case, capitalize the first letter of each word after the first letter, such as: eggcount -> EggCoun

Guess you like

Origin blog.csdn.net/weixin_62991876/article/details/122443780