The purpose of this article is to sum up some experience to use Java so many years of experience, and some basic knowledge of Java is the main point, so to be able to share Java programmers just getting started and going to the Java development in this profession quasi novices, I hope everyone can give some experience to make you better learn and use Java.
The main content of this introduction is J2SE related parts, in addition, it will introduce some J2EE related content in the future, and the relevant contents of various frameworks in Java.
After so many years of Java development and interviews with Java developers in peacetime, I think J2SE is mainly about following aspects.
1. JVM correlation (including the features of each version)
For people who have just come into contact with Java, JVM related knowledge does not necessarily need to be understood, and there is some simple understanding of the concepts in it. But for a senior developer with more than 3 years of Java experience, not JVM is almost unacceptable.
JVM is the foundation of the Java running, and it's hard to believe that people who don't know a bit about JVM can eat the Java language very well. When I was interviewing developers who had more than 3 years of Java experience, JVM was almost a question that must be asked. Of course, JVM is not the only interview question that determines the quality of the technical ability, but it can be used to prove the ability of Java to develop.
In the large class of JVM, I think the knowledge that needs to be mastered is:
JVM memory model and structure
GC principle, performance tuning
Tuning: Thread Dump, analysis of memory structure
Class binary bytecode structure, class loader system, class loading process, instance creation process
Method execution process
New features provided by Java updates in various major versions (need to be understood briefly)
2. Java operation (essential)
This may be easy to see. Who won't run the Java program? But a lot of the time, we just simply run the Java program through IDE, and how does the underlying IDE execute the Java program? A lot of people don't know.
This knowledge point is the most basic java developer needs to master, beginner java, the first is sure to teach you how to execute Java program in the command line, but many people forget Java once they finish learning IDE. Why do we need to know this? After knowing the most pure startup mode of Java, you can analyze how many directories you started at that time, how to execute the naming, how the parameters are, and whether there are missing when launching the problem. It is better for you to solve the real development and environment that may be strange related problems.
The knowledge that needs to be mastered here is:
Javac compiles the java file as the class file
How the Java command is used, how the Java class with package is started in the command line
The Java program involves the various paths (classpath, Java). Library. Path, the main directory of the Java run, etc.
3. data types
There is nothing much to say about the basic type and type of object in Java. Can understand how JDK automatic conversion of knowledge, including boxing, but also pay attention to avoid the same type of judgment after packing
Main knowledge points:
Basic types: int, long, float, double, Boolean,.
The corresponding object type: Integer type conversion to basic types, packing and unpacking
Object type: equals, hashcode
The characteristics of the String type
4. objects and instances, the creation of objects
In this respect, developers need to understand the concepts and differences between class and instance, which is a basis for Java object oriented features. The main knowledge points are:
The concept of Class and Instance
The process created by Instance:
1. No inheritance: allocating memory space, initializing variables, calling constructors
2. Inheritance: static action, allocation of memory space, defined as the initial value, from the base class - > subclass, the initialization process definition, implementation method
Points to be paid attention to:
The static attribute is initialized from a base class sub - >
Characteristics related to default parametric construction methods
5. access control
This is also a basis for the Java encapsulation features that need to be mastered:
The modification effect of public protected default private on class, method, field
6. process control
Java is the basis of process control, although some syntax may not be very common, but it needs to be understood and used in the right place.
What needs to be mastered is:
If, switch, loop, for, while, and other process controlled syntax
7. concept of object oriented programming
This is a core concept of Java and needs to be proficient in any Java developer. Many of the features or knowledge points in Java are related to the concept of Java object oriented programming. In my understanding, a good developer not only need to understand these characteristics (knowledge), also need to know these objects in the object oriented programming concept in Java is how to embody, so more conducive to Java developers to master this language and other languages, object oriented programming. Here is simply a list of the main points of knowledge that include:
Object - oriented three features: encapsulation, inheritance, polymorphism, definition, features, and usage scenarios
The concept of static multi division, dynamic mono assignment
The concept and use of heavy load
Inheritance: multi interface implementation, base class inheritance
Abstract, abstract class, interface
Polymorphism: concept and use of method coverage
Static attributes are also frequently used in the daily development of Java. They need to know the usage related to static keywords, and cooperate with other keywords, such as whether they can be combined with keywords such as abstract and final.
The main needs to be mastered are:
The definition of static properties, use, and how to initialize the class load
Definition and use of static methods
Definition and use of static class
Definition and timing of static code block
9. basic knowledge points
Here are a number of scattered, no systematic java knowledge points. Many of them are used in the daily development. There's a lot of this, but it's just a brief summary of these:
Equals, hashcode, string/stringbuffer, final, finally, finalize
10. set frame
This is a part of the need to master, to do java development, it can be said that it is not used to the collection framework, which is important. But this knowledge is not difficult to understand, but for the best way to achieve the internal collection, because this will help to select a suitable framework to solve the problem in different scenes to you, such as a set of 1W elements, often need to know the contains to judge the operation, the characteristics of the collection or internal implementation, it it is easy to make the right choice.
This includes the following: (concurrency correlation is not included):
The system of the set framework: the base Collection, Map
Specific collection implementation content, List, Set, Map specific implementation, internal structure, special methods, application scenarios, and so on
The usage of the set - related tool class, Collections, and so on
11. anomalous framework
Exceptions may not be so valued in the development of Java. General exceptions, directly up, or after catch treatment for the overall operation of a free program has no what a big impact. However, in the enterprise design and development, the quality of the abnormal design and processing is often related to the overall robustness of the system. A good system is abnormal for developers, treatment should be unified, avoid scattered throughout the many exception handling logic; for the system, exceptions should be controlled, and is easy to operation and maintenance, some abnormal, there should be a way, know how to maintenance treatment, so although abnormal frame is very simple, but for the development of enterprise application, exception handling is very important, you need to understand the abnormal abnormal handling system in Java.
This part of the knowledge that needs to be grasped is not much, mainly:
The difference between the RuntimeException and the general Exception, the specific processing method, and so on
Java learn to exchange QQ group: 589809992 we learn Java together!
12. Java IO
IO is not just as simple as reading and writing in the file, but also in all the input and output operations of the socket network, such as reading and writing, and so on in Java. For example, the reading of the content of Post in the standard HTTP request is also an output process, and so on...
For IO, Java not only provides the basic Input, Output API, also provides a number of simplifying the operation of the Reader, Writer and API, in some development (involving a large number of IO projects in operation) is also very important, the general daily development will involve (read and write log, temporary files, etc.).
The main points of knowledge here are:
Basic IO system: including InputStream, OutputStream, Reader/Writer, file reading, various stream reading, and so on
The concept of NIO, the way to use it and the use scene
13. multithreading concurrency
Multithreading is the most difficult one in Java. Multi thread use can effectively improve CPU utilization rate, improve the overall efficiency of the system, especially in a large number of IO blocking conditions; but it is also a double-edged sword, if not, the system not only improve little or no improvement, but also bring debug multithreaded between the problems.
There are many contents in multithreading. It's just a brief description of the knowledge points that Java need to master in multithread. Later we have the opportunity to introduce some advanced features in detail.
Implementation and startup of multithreading
The difference between callable and runable
The characteristics and comparison of syncrhoized, reentrantLock
Future asynchronous way to get the execution results
Java also provides a API that can operate directly on the TCP protocol and the UDP protocol. When the network performance needs to be emphasized, TCP/UDP can be used to communicate directly. Looking at the source code of Tomcat and so on, you can see the use of these related API. However, in general, TCP will be directly used. It will be processed by using frameworks such as MINA and Netty, because there is not much development involved in this aspect, so it will no longer be listed in detail.
15. time and date processing
For almost every application, the processing of time and date is not past, but the time - related API usage before JDK8 is not friendly. In that era, Joda and other time frames could be selected. After the release of JDK8, the new time API basically combines the advantages of other frameworks and can be used directly.
For Java developers, it is necessary to use API skillfully to deal with time and date.
The specific knowledge points are no longer listed, and a special article will be written in the future to summarize the usage of the time and date API in JDK8.
16.XML parsing / JSON parsing
Actually, these two contents are not the contents of J2SE, but in daily development, interaction with other programs and interaction with configuration files is more and more inseparable from the analysis of the two formats.
However, for a developer, it can help you understand the principles and methods of XML/JSON specific analysis, and help you better choose your way in every specific scenario to make your program more efficient and robust.
XML: you need to know the basic principles of DOM parsing and SAX parsing and their respective application scenarios
JSON: you need to understand the usage of some common JSON frameworks, such as Jackson, FastJson, Gson and so on.
The use of 17.Maven
Maven is not the content of Java, but Maven is revolutionary, which brings great convenience to the development of Java. From the introduction and management of dependency, developing process updates and output and even version update, using Maven can greatly simplify the complexity of development process and save a lot of time. It can be said that Maven has become a standard for Java developers. So I also use Maven as a basic knowledge point for a java developer. Will put on some of my Maven for some use experience and skills, there is no details.
This is a new concept of JDK5 was introduced, is actually a sugar in the preparation of Java code may be convenient, the general application or business development, only need a simple to use, not necessarily be used to define a generic such operation, but the development of some basic public components will be used to, when in need then look at this part, generally as long as simple to use.
It was also introduced after jdk5. Spring is an excellent framework, with XML as the standard configuration file at the very beginning. However, after Spring3, especially after the rise of spring-boot, it is more and more popular to use annotations to simplify XML configuration files. For developers, it can save many XML configuration time. But the disadvantage is that labels are scattered in different classes. Unlike XML, it can have a global understanding and management of all configurations, so there is no way to say that it completely replace all XML. For general developers, they can use annotations. Some developers who are public building may have to understand the definition and implementation of annotations, and can see carefully when they are needed.
RemoteMethodInvocation, Java language unique remote call interface, the use is relatively simple and convenient. However, when you need to cross language, you need to use WebService and other ways to support it. Generally speaking, programs do not need to use RMI, but they can be used in specific situations. In a project, I use RMI to control remote startup and stop.
Java Native Interface allows the local interface method to be invoked in Java, which is generally used for the call of the C/C++ code. We need to pay attention to the path problem of loading so/dll files in Java. Calling interfaces in itself is not complicated, but it often takes a lot of time to load the required local interface library.
The above is just simply introduced me to some of the views and introduces the basic knowledge and technology of these Java points, these contents are derived from these years I use some of the Java summary, hope to just contact Java, or to the development of Java some experience, hope to be able to learn more effectively and use Java avoid detours to waste precious time. There are some areas in which the content is not perfect, and will be added through later articles. Due to the limited personal ability, of course, there will be some mistakes and omissions in it. Welcome to correct and discuss together, and work together to perfect this article, hoping that it can really help people in need.