Dark Horse programmer's day

Source: Internet
Author: User

-------Android Training,Java TrainingWe look forward to communicating with you!
----------

Today, I took a course from instructor Zhang. He started from the most basic lectures, such as Eclipse and IDE (integrated development environment), as well as Eclipse View Management andProgramDebugging, there is a Java TemplateCodeIn Java, a project is created in a single space. If you modify some system attributes and templates of Java, it is only useful in the current workspace. If you change the workspace, You have to modify it again.

To import an existing project in eclipse, perform the following steps: 1. Put the project to be imported in your current workspace. 2. Select the project to be imported in eclipse.

Java static import is used as an example: Import static. java. lang. math. * When you import this class, if you need to use the static method in math, you should not use math. the method name is used, but the method name is used directly. This is the benefit of importing static classes.

Variable parameters refer to the ellipsis (...) that appears in the method (...) for example, the method name (int x, int... arrg), variable parameters in the method body are used as arrays, for example, arrg [].

The following example shows an enhanced for loop: For (type variable name: Set variable name:

 
Int [] numarray = {3, 6, 8}; For (INT num: numarray) {system. Out. Print (Num );}


Automatic unpacking and packing refer to the 8 Basic Data Types in Java, for example, integer a = 1; that is, automatic packing means that integer 1 is encapsulated into an object. In fact, unpacking is to extract 1 from the object and perform integer operations, for example:

 
// Binning integer num = 10; // unboxing int num1 = num;

Enum (enumeration) is a new feature supported by Java 5. It defines a set of related constants in a type so that only these finite constants can be used during use. Example:

Enum weekday {Sunday, Monday, Tuesday, wednsday, Thursday, Friday, Saturday };

The above Code defines seven constants in the weekday enumeration class. Note that the last semicolon can be omitted. If you want to add a method in it, you must add a semicolon, it must also be written under the seven constants; otherwise, an error is reported. Because weekday has only seven members, weekday variables can only take one of them.

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.