Zero-based learning Java, you must get to know the 10 questions!

Zero-based learning Java, you must get to know the 10 questions!
The Java language is popular in the current Internet industry, not only to Android and web development but also widely used in the field of financial services, high-frequency financial space. It is also because of the heat remains high, more and more people choose to learn the Java language. Then the zero-based learning Java will need to get to know those problems?
1, the characteristics of the Java language, the difference between Java and c ++
Java language is easy to learn, security, reliability, support multi-line programming, compilation and interpretation of coexistence, regardless of the platform and so on. Java and c ++ is object-oriented language. The difference is, C ++ classes support multiple inheritance, while Java is a single class inheritance, but the interface is multiple inheritance.
2, the difference between Java applications and applets
general, applet small program is not the main method, but similar to the flash game, mainly embedded run on the browser page, and the application is to use the main method, that is the main thread starts.
. 3, three properties of the object-oriented Java programming
three features of the Java object-oriented programming are: encapsulation, inheritance, and polymorphism.
Package: upcoming privatization of a property of the object, while some may be ways to access the properties of the outside world. The case of properties not want to be accessible to the outside world, the method can not provide access to the outside world.
Inheritance: That saved using the defined class to create a new class as a basis. Defining a new class not only adds new data and functionality and can use the function of the parent class, but not selectively inherit the parent class.
Polymorphism: refers to the particular type of reference variables defined in the program pointed to this reference variable and depend on the method call issued by the program is not determined. But before deciding during operation.
4, an object-oriented and process-oriented distinguish
a first, object-oriented with encapsulation, inheritance, polymorphism, etc., it is possible to design a low coupling system, and easy to maintain, reuse, and extension. Object-oriented and disadvantages in terms of performance is lower than the process-oriented.
Second, the process-oriented performance compared to the advantage of object-oriented lower. The disadvantage is that the maintenance, multiplexing, less than the role object-oriented extensions.
5, the difference between overloading and rewriting
Overload: overload occurs in the same class, method name must be the same, and the parameter type, the number, order may be different.
Rewriting: rewriting occurs in the parent-child class, the same method name and parameters to ensure that the column, but the scope of the return value, the abnormal range or less thrown parent; and access modifiers is greater than or equal parent class.
6, the difference between the member variables and local variables
First, in terms of grammar. It belongs to the class member variables, and local variables are the variables or parameters of the method defined in the method; local variables differs member variables, static can not be modified, nor can it be modified by the access control modifiers.
Secondly, from the terms of the survival time variable in memory of view. With local variables will call a method of automatically disappear, and is an integral part of the member variables, it will create an object exists with.
In addition, if the member variables are not given initial value, it will automatically defaults to the type of assignment, but local variables are not automatically assigned.
7, the characteristics of the construction method which
characteristics constructor include: return value does not exist, but not declared by the constructor void; class object generation performed automatically, not allowed to call; the same names and class names.
8. What is the return value of the method? What role in the return value of the method in that class?
The return value is the so-called method refers to a method of obtaining the effect of the body generated code execution. Its role is to accept the results used for other operations.
9. What are the basic state of the thread there?
Java threads are divided into basic state NEW (initial state), RUNNABLE (operational status), BLOCKED (blocked), WAITING (waiting state), TIME_WAITING (timeout wait state), TERMINATED (suspended state).
10, Java serialization If you do not want to serialize some fields, how to deal with?
Use the keyword transient modification for treatment do not want to serialize variables. But only transient variables can only be modified, but can not modify classes and methods. Its value is modified variables will not be persisted will not be restored.
To learn java, java a good set of basic data is essential, you can believe me or private comments in the article below, I will give you free to share video document has, very new year!

Guess you like

Origin blog.51cto.com/14623707/2463222