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:
String: In C #, the first letter of the string is lowercase, not the same in Java. Uppercase is required. That is, string.
convert int to String:Integer.toString (1200); The string is converted to Int:Integer.parseInt ("1200");
Method names in C # are capitalized, and methods in Java are first lowercase, such as getnum ()
The inheritance and implementation interfaces in C # are: English colons, in Java inheritance is: extends. The implementation interface in Java is implements
Parameters in Java are not ref and out
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
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.
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
The file name in Java must match the class name.
The package name of the class must be migrated with the folder path.
You do not need to write the override keyword when overriding a method.
The comparison of strings uses the Equals method. Cannot use = =. = = Indicates whether the same object is in Java. Reference the same address.
Classes in Java must conform to the JavaBean rule. What is the JavaBean rule?
Must have an argument-free constructor
field cannot be public
The fields of the class must be accessed using the get and set methods.
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