The initial Java knowledge of Java!

Source: Internet
Author: User

1. What is a computer program?
Parsing: A collection of ordered instructions written to solve a problem.
What are the 2.Java related technologies?
Parsing: javase (desktop application) Java EE (website) javame (mobile app)

3. What are the steps to develop a Java program?
Parsing: Writing, compiling, and running

what is the basic framework of a 4.Java program?
What are the annotation types for 5.Java?
Parsing: Single-line comments and multiline comments.
6.C (Client)/S (Server) Program: No browser is required to parse the executed program
B (broswer)/S (Server) Program: You must use a browser to resolve the executed program
7. Steps to write the first Java program
01. Configure Environment Variables
001. Right click on my computer → properties → advanced system settings → environment variables → system variables, in system variables
To find the name of a variable with a path, click the "Edit" button and press the "Home" key to
Cursor is positioned to the first position
002. Open "My Computer" → Open the C drive → find "Program Files folder" →java→jdk1.7.0_17
→bin, copy Path
003. Paste the copied path to the position where the cursor is flashing, followed by a semicolon (;)
004. Make sure that all the windows disappear.
005. Open "Start" → "run" → input cmd→ input javac Enter, if there is a series of Chinese, prove
The environment variable was configured successfully.
02. Writing Code
001. In the root directory of the D drive, create a file with a suffix called Java named hello.
002. Writing code
03. Compiling
Use the Javac command to compile a file with the suffix. Java as a file with a. class suffix (bytecode file)
04. Running
A file with a. class suffix is run with the Java command, and the suffix name does not need to be run.

2014-05-21

I. Java program compilation and execution process
01. The file with the suffix. Java is compiled by the Java compiler into a file with the suffix. class.
02. The file with the suffix. Class is compiled by the JVM (Java Virtual machine) for the second time and compiled into a CPU to
Code to identify


Ii. Considerations for writing Java programs:
01.java code is strictly case sensitive.
02. Curly braces to appear in pairs
03. Write the left curly brace ({) At the end of a line of code
04. The code should be written into the inner frame.
05. All the code we write is in the English half-width state, otherwise error may occur
Each statement in 06.java ends with a semicolon
07. Class names cannot start with a number
Three, println () and print () differences
IV. Escape character
\ n: Line break
\ t: a series of spaces
v. Comments in Java
The role of annotations: 01. Facilitate later maintenance of the project
02. Facilitate the reading of members within the team
03. Comments will not be compiled by the Java compiler, Java compilation will be skipped comments
Why write comments: In order to follow us to read the code convenient, so we have to 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//
The second type: Multiline comment/**/
If the cursor renders a relatively wide style, press the INSERT key on the keyboard to restore the cursor.

Vi. Creating a Java project in MyEclipse
01. Change Workspace: Click File→switch workspace→other→browser→ Select the D-Drive
A folder, click OK, the environment will automatically close. The first phenomenon: to quote a red fork,
The second phenomenon: ask if we want to go to Software Center (software), tick the checkbox, and click Cancel.
02. Create a Java project: Click File→new→java Project
03. Right-click on the src folder, New→class
04. Write the code, after writing, run the program through run (green triangle icon)
The results of the operation appear on the console console.
Seven, how to adjust the font size in MyEclipse
Find windows→preferences→ Input fonts in the menu
Remaining content See picture
VIII. organizational structure of Java projects
01. Package Explorer
Classes to manage multiple different functions
02. Navigator (Navigator)
Role: Similar to Windows Explorer, skills to see Java files, but also to see the compiled class file
Ix. Common operation of MyEclipse
01. How to display line numbers
Official resolution: Right-click on the left-hand side of the code editing area, and in the popup menu, tick the
Show Line Numbers
02. Deleting items
              Select the item you want to delete right-click, and then find the delete, but note here, don't
              , otherwise the real files on the hard drive will be removed. Then OK
           03. How do I import a project??
               Parse: file→import→general, find the longest item, then browser
            04. How to rename the project
               Resolution: Select the name of the item you want to modify, press F2 on the keyboard, and then make sure.
8.java structure inner layer framework four elements:

public static void Main (string[] args)

{
}

The initial Java 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.