Chapter One: first knowledge of Java

Source: Internet
Author: User

Computer program: A set of ordered sets of instructions produced by a computer to accomplish certain functions.

Java technology includes: Javase (Standard Edition) Java EE (Enterprise Edition)---javame (mobile version)

development Java program steps: 1. Write 2. Compile 3. Run.
1. Write:
a. Curly braces appear in pairs
The words following the span style= "font-size:18pt" >b.class are identical to the file name. (!! Include case)
c.java strictly case-sensitive
2. Compiling:
command: Javac file name. java
Produce the result: A. class suffix file (this file, unreadable, garbled)
(note!!! If the code is modified, it needs to be recompiled and run)
3. Run:
Command: Java file name (no suffix!!)
produces the result: output information
source program: to. Java end
compiled file: End With. class

Code parsing:
The outer framework of the public class demo{//program (class framework)
public static void Main (string[] args) {//program's inner frame (Main method)
System.out.println ("java!! Hello! "); /printout (add line wrapping at the end)
System.out.print ("hello!"); /No line break after printing
}
}

Escape character:
\ n wrap \ \ tab (equivalent to a tab in the Keyboard tab equivalent to 8 spaces)

Comments:
Single-line Comment://ctrl+/
Multiline Comment:/* start, */End ctrl+shift+/ctrl+shift+\ Cancel

Specification:
1. Same level, left-aligned format code: CTRL+SHIFT+F
2. To be included, to indent (Tab)
3. Class naming, Pascal (the first letter of each word capitalized, other letters lowercase), see the name of righteousness such as MySchool

To import a project:
Menu bar First (File), oblique-down arrow (Import), first plus sign expand, select Longest-click browse button, select the project folder->finish
Show line number:
Left scroll bar right click to check Show line numbers

To configure the environment variables for the JDK:
1) Create a variable in the system variable
Name: Java_home
Value: is the path where you install the JDK, for example: D:\MyEclipseY2\jdk1.6.0_24
2) Locate the path variable in the system variable

Chapter One: first knowledge of Java

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.