Java Basic Key Guidelines
Everyone has their own way of learning, here are some of the key points I summarize after studying Java:
One: (understanding) Java was born in 1995 and was developed by Sun Company. It compiles the source code into an "intermediate code" and then "translates" the intermediate code into a machine code through the "Java Virtual machine" and then runs it on the machine. Java has 3 versions (Java Se,java Ee,java ME), SE for desktop program development, Java Foundation, EE for enterprise development (such as websites, etc.), ME for embedded development (such as PDA, mobile communications development, etc.). There are many things that can be done through Java, but only if you want to learn deeply.
Second: Use of the Java compiler Eclipse, explore it yourself.
Three: "Package" in Java is similar to namespaces in C + + and C #. Pour the "package" with the keyword "import" and declare the word "packages" as follows:
Affirm a package number:package number;
Pour a package number:import number;
Four: Variable types can be divided into two categories: value type and reference type, and value type is the type in which the declared variable is allocated memory space, and the reference type is the type that declares that the variable is not allocated memory. You don't have to distinguish between those types that are value types when you use them, and those that reference types, which are just as good as when you're learning.
Reference type variables must be bound to an instance before they can be used!!!!
Five: variables, constants, operators are similar to C + +, in addition to some of the keyword differences need not be too concerned about, you can skip.
Six: Data type conversions (implicit and display conversions), similar to C + +, are recommended to skip.
Seven: annotations are like C + + and are recommended to skip.
Eight: Process control is the same as C + + (conditional statement, select statement, loop statement), it is recommended to skip.
Nine: String class, it is recommended to study carefully, because in Java this level has been very little to use the array, more time is to use the already encapsulated string class and list<t> and so on.
Ten: The Java array is different from C + +, just pay attention to some differences, do not need to be too serious.
11: Class: In Java the declaration of the class differs from C + +, all the default member variables are private, if not private, you need to change their properties before the corresponding members, as follows:
Pubilc class book{
private String name;
Public String GetName () {
int id=0;
SetName ("Java");
return id+this.name;
}
private void SetName (String name) {
This.name=name;
}
Public book GetBook () {
return this;
}
}
This point to an instance of an object. Pay special attention to the difference between static and non-static.
12: Learn some packaging classes.
13: Inheritance, interface and polymorphism. To focus on understanding!!! The inheritance of a class in Java can have only one parent class, but there may be multiple interfaces:
The Declaration of the interface:
public interface a{
Public String etname ();
}
Declaration of the class:
public class b{
protected String name;
}
Public Class Test extends B implements a{
Public String GetName () {
return name;
}
}
Note the members of the interface default to public.
14: Focus on understanding anomalies!!!
The above is the basis of Java, to the later high-level topic parts need to pass the project to better explain, here is not caught dead. And the Java Foundation is too similar to C + +, it is not recommended
In this painting too much time, learning Java is the main learning is the advanced theme behind!!!
Key Java Essentials Guide