Java Basics no1--Configuration and naming rules for environment variables

Source: Internet
Author: User

tags (space delimited): Java BasicsOne: Computer Overview
Computers: Hardware and software
Hardware: Controller operator memory input and output devices
Memory  : External memory (hard disk) memory
Software: System software application software
  system software: Windows Linux DOS IOS Android Unix MacOS
  Bare Metal: No operating system installed
  application software: QQ Office MD  web App
Second: Software development and computer language
  • What is software? A collection of data and instructions in a specific organization order

  • Computational language classification: Machine language (binary 0 and 1) assembly language (special symbol) high-level languages (JAVA C C + + C # ...)

Three: human-computer Interaction
In two ways: a command line  two graphical interface
New ways to interact with languages: Siri Chinese voice
Four: Keyboard function keys and shortcut keys
Tab: Tab shift up conversion key CTRL control key ALT Change
Shortcut keys: Ctrl + C Copy Ctrl + V Paste Ctrl + Z Undo Ctrl + X cut
CTRL + A Select all CTLR + S Save
Key combinations: Windows +e open My Computer windows + R Open run
Input: OSK This command
V: How to open the DOS console
Fastest: Windows + R input cmd command
Seven: Java language overview
The father of Java: James Gosling high Commander Gosling
Java version 1.5 Tiger 1.6 Mustang 1.7 Dolphin
    • Javese: Standard Version

    • Javame: Small Edition small device

      • Java EE: Enterprise Edition

      • Java language Features: Object-oriented multi-threaded simple open -source cross-platform

Eight: Cross-platform principle
    • Cross-platform: can be run on different operating systems

Programs written in the Java language can be cross-platform, through a virtual machine (JVM)
* * Virtual machines cannot cross platform!**
Depending on the operating system, downloading and installing different virtual machines is possible.
Nine: JRE and JDK
  • JVM: Virtual Machine

* Jdk:java development tool +JRE: suitable for Developers
* No need to install the JRE after installing the JDK
10: Download of JDK
Download path [click to download] (http://www.oracle.com) This path
JDK default installation: C:\Program Files\java
11: JDK Directory explanation
    • Bin directory: The executable program is placed

      • Javac:java Compilation tool (compiled Java language)

      • Java:java running tool (running)

      • Javadoc: Generate document Tool JRE directory: JDKheader file containing JRE include:c++ src: Source code lib: Core class library

12: Development Tools

Notepad Notepad editplus editor Eclipse MyEclipse

13: HelloWorld Case writing ( very important )
HelloWorld {
     Main (args) { 
  System.  Out. println ("Hello world!");   
  }
}
14: Common Mistakes
    • Common errors

      • File not found cause: the name of the run was wrong: the main class could not be found or could not be loaded

      • Incorrect spelling of letters

      • Name extension error

15: Writing Format
    • Left curly braces to write in pairs

    • Space before opening curly brace

    • The opening curly brace to indent

Configuring the PATH environment variable ( important )
  • Why would you want to configure the path path?

  is to run Javac and Java commands in any directory
* How do I configure the PATH environment variable?
  First configuration scenario: My Computer-Properties-advanced-environment variable---system variable--path---Edit----at the front (note: do not delete!)--Copy the Bin directory path to the; semicolon before---OK--OK
  The second configuration scenario: My Computer-Properties-advanced-environment variables---system variables--path---The installation directory of the JDK for the new java_home---input, including the bin---in Path, through%java_home%\bin;
Think about it? Is it only the JDK that needs to configure the PATH environment variable?
classpath environment variable configuration
No configuration is required, JDK1.5 is performed by default on the current path.
Path and Classpath differences:
  path: The executable file is configured
  ClassPath: The Java class file is configured
configuration of the EditPlusNotes
Category: Single-line comment  Multiline comment document comments
Single line://Comment text
Multiple lines:/* Comment Text */
Document Comment:/** the text of the comment  */
Note: Single-line comments can be nested multiple lines of comments can not be nested
Multiline comments can be nested in a single-line comment,
keywords ( very important )
What is a keyword? A word that is given special meaning by Java is actually an English word.
There is a special meaning.
identifiers ( very important )
Composition: English alphanumeric _ and $  Chinese (not recommended)
Precautions:
  * Numbers do not start
  * Cannot use keywords
  * Strictly case-sensitive
Example:
identifier naming rules ( proficiency )
Package Name:
  All lowercase
Naming of classes and interfaces
Capitalize the first letter  of a single word, and capitalize the first letter of each word in multiple words
  Example: HelloWorld  Login Load
Variables and methods
  single word all lowercase, multiple words, second word, first letter capitalized

Java Basics no1--Configuration and naming rules for environment variables

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.