Java Language Foundation Part1

Source: Internet
Author: User
Tags java keywords

Mobile Internet: It is the combination of mobile communication and the Internet to become one. Refers to the Internet technology, platform, business model and application of mobile communication technology combined with the practice of the collective name.
DT: to serve the public, stimulate productivity-based technology, DT is the English abbreviation for data processing technology
Operating system:(Operating system abbreviated OS) is a computer program that manages and controls computer hardware and software resources, is a basic system software that runs directly on "bare metal", and any other software must be run with the support of the operating system
Platform Affinity: We call the hardware or software environment that can support the program to run as a platform, different platforms have their own specific instruction format, that is, the command format of Win support and Linux supported instruction format is not the same
win+d back to desktop Win+e open My Computer ALT + TAB (WIN+TAB) Project Toggle win+l Screen lock win+r run 1. Enter Calc to open the Calculator 2. Enter the MSPaint to open the drawing board 1. Hold down the SHIFT key within the folder At the same time, right-click, choose here to open a command window, you can open the corresponding location of command prompt 2. After you run the command prompt on the desktop, enter the appropriate hard disk with a colon (for example: E:) in the command prompt, and then enter the CD path 3.CD. Go back to the path of the previous level directory 4.CD/ Back to the root path of the current drive letter
Decimal Conversion to binary: The decimal number is divided by 2, the last fetch quotient and the remainder, the quotient as the first digit of the binary, the remainder from the bottom to the top of the binary number, the first bit is the sign bit
Binary to decimal: The last digit of the binary to the first, multiplied by 2 of the 0, the second multiplied by 2 of the 1 parties ... And so on, until the last one multiplied by 2 of the n-1, the result of the multiplication of all add, you can get the corresponding decimal number binary source code, anti-code, complement: The first digit of the binary is 0, is positive, positive number of the original code, anti-code, the same complement; the first digit of the binary is 1, Represents a negative number, the inverse of a negative number: In addition to the sign bit, the other bit reversed, the complement of negative numbers: the last of the anti-code plus 1
Computer language: refers to the communication between man and computer a special language, is the transmission of information between people and computer media (software is composed of several computer instructions) computer language classification: 1. Machine language 2. Assembly languages 3. Advanced Language
Java language Features: simple, object-oriented, secure, cross-platform, multi-threading, robust, distributed, etc.
The principle of Java cross-platform:1. Platform-independent bytecode files are generated after compilation 2. Virtual Machine (JVM) JVMs that depend on different platforms are not cross-platform
JDK:Java development tools, including all tools to develop Java programs, such as Javac,java, the JDK contains the JRE
JRE:Java Runtime Environment, if you want to run a Java program, you need JRE support, the JRE contains the JVM
JVM:A Java Virtual machine, a virtual machine running all Java programs, the JVM is the Java language's operating environment and one of the most attractive features of Java. The JVM is used to read and process a compiled platform-independent bytecode file (. Class) for Java portability. The JVM is not cross-platform, that is, win to install the win version of the virtual machine, Linux installed Linux version of the virtual machine. JVM is the explanation and executor of Java program
features of folders under the JDK installation directory: bin: A Java-enabled operating tool, such as the Compile tool Javac, launches the JVM's Java DB: Database Derby for Java testing, enterprise not include: Store C + + Header file Jre:java, which has the source code of the core library Src.zip:Java that the JVM Lib:java runs and relies on
Write the first program:(changed the source file, must recompile) requirements: In the console interface output: Hello, you have worked hard development steps: 1. Create a new text document on the desktop named Hello.java Note: Java is the suffix of the file, which is the extension name 2. Open the Hello.java file by using Notepad, and type the following public class hello{} 3. Open the Desktop Command Console window, enter Javac Hello.java to compile the Hello.java file, compile successfully, will appear on the desktop a Hello.class file (bytecode file) 4. Start the virtual machine, load the Hello.class byte code, and explain the execution, enter Java Hello, do not need to enter the. class, the error is displayed: The Main method is not found in class Hello, define the Main method as: public static void Main (string []args) 5. The fix code is as follows: public class hello{public static void main (string []args) {System.out.pri NT ("Hello, hard"); }} in console input javac Hello.java input Java Hello, print out in console hello, hard.
CLASSPATH is the path to the class file, which indicates where the JVM is looking for the class file path refers to the location of the Java development tool
Put the compiled bytecode file into the specified folder: javac-d file name Hello.java printout: java-classpath filename Hello
Java Basic syntax:1.Java language is strictly case sensitive 2. A Java source file can define multiple classes, but at most one of the classes is defined as the public class, if the source file contains the public class, the source filename must be the same name as 3. When a source file contains n Java classes, the compilation generates n bytecode files, that is, each class generates a separate bytecode file, and the byte-code filename is the same as the corresponding class name 4. If a class needs to run, you must have the main method, because the main method is the entry for the program
Programming Recommendations:1. A Java source file defines only one class, and different classes use different source files to define 2. Use the public modifier for each class defined in each source file 2. Keep the main file name of the Java source file consistent with the class name
Note: //single-line comment/* Multiline comment *//** Document COMMENT * * Multi-line comments and document comments cannot be nested with each other
Keywords and reserved words (all lowercase): keywords: in programming languages, there are some pre-defined words reserved words with special meanings and uses: Like keywords, the programming language is defined in advance, only to say that there is no special use for the time being, But maybe someday it will suddenly be given meaning and be used, so the words that are preserved are goto and const are the reserved words of Java
Java language delimiter: (must be a symbol in the English state) 1. Semicolon, the split of the statement, which represents the end of a sentence of 2. {} curly braces, which represent a block of code, are a whole, to be paired appears 3. [] in brackets, define arrays and access array elements when using 4. () parentheses, the use of a wide range, specific to the specific analysis of 5. A dot, class, and object that accesses its members using 6. Space, a whole sentence divided into a few paragraphs, the number of spaces unlimited expansion, like a word in English should be written separately
identifiers: When writing code, in order to enhance the readability of the code, it will customize a lot of names, such as: Class name, method name, variable name and so on. In programming, we call this a name that is customized to enhance the program's readability, called an identifier. Identifier naming rules: 1. Composed of letters, numbers, underscores, $, but not starting with numbers (the letters here can be Chinese, Japanese, etc.) 2. Case Sensitivity 3. Do not use Java keywords and reserved words 4. Do not use Java built-in class names for their own

Java Language Foundation Part1

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.