Wednesday (2015.7.22) Learning content

Source: Internet
Author: User

Wednesday(2015.7.22)Learning Content: A.What is a computer program??

is a collection of ordered instructions written to solve a problem.

Two. JavaWhat are the relevant technologies?

Javase ( desktop app ) Java EE (website ) Javame ( mobile app ), which has now been Android Replace

Three.DevelopmentJavaWhat are the steps of the program?

Write first, then compile, and then run.

detailed steps for writing a Java program

1. Configure environment Variables

(1). first right click on my computer → properties → advanced system settings → environment variables → system variables, in the system variables to find there is no name path variable name, if any, directly click on the "Edit" button, and then press "Home" key to position the cursor to the first location

(2). turn on "My Computer" → Open C disc → find " Program Files folder "→java→jdk1.7.0_17→bin, copy Path

(3). paste the copied path to the cursor flashing position, followed by a semicolon

(4). then make sure until all the windows disappear.

(5). open "Start" → "Run" → Enter cmd→ input Javac Enter, if there is a series of Chinese, prove the environment variable configuration is successful.

2. Writing code

(1). in the D the root directory of the disk creates a name called Hello the suffix name is Java the file.

(2). Writing code

3. Compiling

Use the Javac command to compile a file with the suffix. Java as a file with the suffix. class.

4. Running

A file with a . Class suffix is run with the Java command , and the suffix name does not need to be run .

Four. what is the basic framework of Java programs?

Analytical:

public class Person {

public static void Main (string[] args) {

System.out.println ("name : Xiao Qiang "); }

}

. javafour elements of structure inner layer framework:Public static void Main (string[] args) {} Five. MyEclipseUse of tools

Six . Escape Character

\ n: newline \ t: a series of spaces

Seven. JavaWhat are the annotation types?

Parsing: The role of annotations:1. facilitates later maintenance of the project ; 2. facilitate the reading of members within the team ; 3. comments are not Java Compiler compiles, Java The compiler will skip comments .

Why write comments: In order to later we read the code convenient, so we should develop the habit of writing notes .

Because the comments accounted for three points during the final exam, the comments accounted for a large proportion during the interview.

First Type: Single line comment //, Second: multiline comment /**/

Eight.WritingJavaNote for the program:

1.java code is strictly case sensitive.

2. curly braces to appear in pairs

3. Write the left curly brace ({) at the end of a line of code

4. The code should be written into the inner frame.

5. all the code we write is in the English half-width state, otherwise error may occur

Each statement in 6.java ends with a semicolon

7. class names cannot start with a number

9, inMyEclipsein creating aJavaProject

Project name to specification:Demo1

Package name naming specification:cn.bdqn.test

Class name specification: Capitalize first letter

Ten.How to adjustMyEclipsethe font size in

First find Windows→Preferences→ input Fonts in the menu

Eleven. JavaProject Organizational Structure

1. Package Explorer

Classes to manage multiple different functions

In the Package Explorer, a folder is formed on the hard disk every point you hit

2. Navigator (Navigator)

Role: Similar to Windows Explorer, skills to see java files, but also to see the compiled class file

TwelveMyEclipsethe common operations

1. How to display the line number

Parse: Right-click on the left blue area of the code editing area, and in the popup menu, tick the

Show Line Numbers

2. Deleting items

Resolution : directly Select the item you want to delete right-click, and then find the delete, but do not tick here, otherwise the real files on the hard drive will be removed. Then click "OK" to

3. How do I import a project ?

Parse: File→import→general, find the longest one, then point browser

4. How to rename a project

Resolution: Select the name of the item you want to modify, press F2on your keyboard, and then make sure you have modified it.

13.when a semicolon is missing in a statement, the error message is:

Syntax error, insert ";" To complete Statement ( syntax error: Insert semicolon Completion statement Description ): when the double quotation marks are omitted, a false hint is : Canno t be resolved(cannot be parsed).

14 . Java Program compilation and execution process

1. The file with the suffix . Java is compiled by the Java compiler into a file with the suffix . class .

2. the file with the suffix . Class is compiled by the JVM(Java virtual machine) for the second time, compiled into CPU code that can be recognized .

Wednesday (2015.7.22) Learning content

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.