Programmer takes you to learn Android development, 10 days fast into-contrast C # learning Java syntax

Source: Internet
Author: User

Focus on today's headlines-do the full stack siege Lion, learn the code to read, love the whole stack, more love life. Provide programmer technical and life guidance dry goods.

If you really want to study, please comment on each article that you have learned, and record the traces of your studies.

Please write the code mentioned in all the tutorial articles at least three times to achieve a familiar effect.

Last lessons:. Programmers take you on Android development, 10-day Quick Start-development tool configuration learning is about the configuration of the Java environment and the installation of the as installation tool.

There are netizens @ Goose Goose _ said, in fact, the JDK environment variable configuration, not configured so troublesome. The current JDK version can only be set with one variable javahome, others can be configured without the need. Mention it here.

Of course, this course can be the threshold is relatively high, you need to be. NET programmer. Because this course is a comparison of C # learning Java syntax.

First, Java Common sense:

    1. String: In C #, the first letter of the string is lowercase, not the same in Java. Uppercase is required. That is, string.

    2. convert int to String:Integer.toString (1200); The string is converted to Int:Integer.parseInt ("1200");

    3. Method names in C # are capitalized, and methods in Java are first lowercase, such as getnum ()

    4. The inheritance and implementation interfaces in C # are: English colons, in Java inheritance is: extends. The implementation interface in Java is implements

    5. Parameters in Java are not ref and out

    6. Remember the sealed class in C #? That is, a class that cannot have subclasses. The class of the FINALLY keyword flag in Java is the sealed class

    7. The finally method cannot be overridden by a quilt class. All the default methods in Java are virtual methods, and subclasses just need to rewrite them. Java does not require keyword virtual rewriting.

    8. A variable cannot be re-assigned to a finally keyword declaration.

II: Packages (Package)

Concept: The package is easy to say. A namespace similar to C #.

Package name: All lowercase by default. Rule: Company domain name reverse write + product name + module Name: For example: Com.chengxiaoxiao.crm.user

You write the package name: The local hard drive will generate the corresponding folder. For example, the above will be formed by COM, Chengxiaoxiao, CRM, User4 folders, ranked by level.

How do I reference a package?

If you want to access resources within other packages, you need to reference the related package resources. For example, we can refer to the above package as follows:

Import Com.chengxiaoxiao.crm.user.

Of course, there is the syntax: Import com.chengxiaoxiao.crm.*:* represents all resources that refer to COM.CHENGXIAOXIAO.CRM subordinates. There are too many references to this. It is not recommended. Refer to the piece if you need anything.

Third, the Java class of the wording

    1. The file name in Java must match the class name.

    2. The package name of the class must be migrated with the folder path.

    3. You do not need to write the override keyword when overriding a method.

    4. The comparison of strings uses the Equals method. Cannot use = =. = = Indicates whether the same object is in Java. Reference the same address.

    5. Classes in Java must conform to the JavaBean rule. What is the JavaBean rule?

      1. Must have an argument-free constructor

      2. field cannot be public

      3. The fields of the class must be accessed using the get and set methods.

      4. Subclass calls the parent class method using the keyword: super

In the next lesson, we will use the above to develop a small program with the source code. Let's experience how Java writes programs.

For more tutorials, you are welcome to focus on today's headlines-making full-stack siege lions. Talk about learning together. A little information, Sohu Media platform, QQ public platform, public platform. Penguin Media platform, UC subscription platform, Baidu release platform are "Do the full stack siege lion." For all resources in this tutorial, please follow: Fullstackcourse. Click below to focus on: Today's headline is the starting platform.

We can also add QQ Group: 538742639, work together. More than 300 technologies Daniel is waiting for you.

Next article Link: Programmers take you to learn Android development, 10 days Quick Start-basic knowledge (iv)

Programmer takes you to learn Android development, 10 days fast into-contrast C # learning Java syntax

Related Article

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.