The purpose of this article is to summarize some of my experience in using Java for many years, mainly related to some Java basic knowledge points, so also want to share to just get started Java programmer and intend to enter the Java development of this profession of prospective novice, hope can give you some experience, Allows you to learn and use Java better.
The main content of this presentation is related to the J2SE, and in the future, we will introduce some of the Java EE-related, and the various framework related content.
After so many years of Java development, and in conjunction with the usual experience of interviewing Java developers, I think the main aspect of J2SE is to master the following content.
1. JVM-related (includes features for each version)
For those who have just come into contact with Java, the knowledge of the JVM does not necessarily need to be understood very deeply, there is some simple understanding of the concept. But for a veteran developer with more than 3 years of Java experience, the JVM is almost unacceptable.
The JVM, as the basis for running Java, is hard to believe that people who don't know anything about the JVM can eat the Java language very well. When I interviewed developers with more than 3 years of Java experience, the JVM was almost a must-ask question. Of course, the JVM is not the only one to determine the technical ability of the interview problem, but can support Java development capabilities.
Among the large classes of JVMs, I think the knowledge to be mastered is:
JVM memory model and structure
GC Principle, performance tuning
Tuning: Thread Dump, analyzing memory structure
Class binary bytecode structure, class loader system, class loading process, instance creation process
Method Execution procedure
New features provided by various major versions of Java (requires a simple understanding)
2. Running Java (Basic prerequisites)
This one may look very simple, Java program run who does not? But most of the time, we simply use the IDE to execute Java programs, and how does the underlying IDE execute Java programs? A lot of people don't know.
This knowledge point is the most basic Java developers need to master, beginner Java, the first is certainly to teach you how to execute Java programs on the command line, but many people once the Java learning, the IDE used, and forget this. Why do you want to know this, know the most pure Java startup mode, you can start the problem at the time, to analyze the number of directories launched at that time, the implementation of naming, how the parameters, whether there are missing and so on. This will help you develop real-world solutions to those weird and potentially environment-related problems.
Here are some of the things you need to know:
Javac compiling Java files as class files
Use of Java commands, how Java classes with package are started on the command line
The various paths that the Java program involves (Classpath, Java. Library Path, main directory of Java run, etc.)
3. Data type
This is nothing more than the basic type of Java and the mastery of object types. You can learn more about how the JDK automatically transforms the knowledge, including packing and unpacking, and also to avoid the same type of judgment after boxing.
Key points of knowledge:
Base type: int, long, float, double, Boolean, ...
Corresponding object types: Integer type to basic type conversion, boxing and unpacking
Object type: Equals, hashcode
Characteristics of String types
4. Objects and instances, creation of objects
In this context, developers need to understand the concepts of class and instance and the difference between them, which is a fundamental aspect of Java's object-oriented nature. The main points of knowledge are:
The concept of class and Instance
Instance the process created:
1. No inheritance: Allocates memory space, initializes variables, calls constructors
2. Inherited: Handles static actions, allocates memory space, variables are defined as initial values, from base class to subclass, handles initialization at definition, executes construction method
Points to note:
Initialization of a static property, such as a subclass from a base class
Default non-parametric construction method related attributes
5. Access control
This is also a fundamental feature of the Java package, which needs to be mastered by:
Public protected default private modifier for class, Method, field
6. Process Control
The basis of Java process control, although some grammars are not necessarily common, they need to be understood and used where appropriate.
What you need to know is:
Syntax for process control such as if, switch, loop, for, and while
7. The concept of object-oriented programming
This is a core concept of Java and requires proficiency for any Java developer. Many features or knowledge points in Java are related to the concept of Java object-oriented programming. In my understanding, a good developer not only needs to understand these features (knowledge points) themselves, but also need to know how these objects are embodied in Java's object-oriented programming concept, which is more useful for developers to master the Java Development language, as well as other object-oriented programming language. Here is simply a list of the main points of knowledge including:
Object-oriented three major features: encapsulation, inheritance, polymorphism; Individual definition concepts, what are the characteristics of the respective use scenarios
Static multi-Dispatch, the concept of dynamic single dispatch
The concept and use of overloading
Inheritance: interface multi-Implementation, base-class single-Inheritance
Abstract, abstract class, interface
Polymorphism: The concept and use of method coverage
Interface callbacks
8. Static
Static properties are often used in Java daily development and need to understand the usage associated with the static keyword, as well as with other keywords, such as whether it can be combined with abstract, final and other keywords.
The main needs to be mastered are:
Definition of static properties, usage, and how classes are initialized when they are loaded
Definition and use of static methods
Definition and use of static classes
The definition and initialization time of static code blocks
9. Basic Knowledge points
Here are some of the scattered, no system classification of some Java knowledge points. In the daily development of the use of a lot. This piece of content actually has many, at present only temporarily summed up these several here:
Include:
Equals, Hashcode, String/stringbuffer, final, finally, finalize
10. Collection Framework
This is a need to master the part of the Java development, it can be said that there is no need to set the framework, this is very important. But the knowledge here is not difficult, but for the collection it is best to understand the internal implementation, because it helps you to choose the appropriate framework in different scenarios to solve the problem, such as a set of 1W elements, often to contains judgment operation, know the characteristics of the collection or internal implementation, It is easy to make the right choice.
This includes the following (concurrency related is not included):
The system of the SET framework: base collection, Map
Concrete collection implementation of the content, List, set, MAP specific implementation, internal structure, special methods, applicable scenarios, etc.
The use of collection-related tool classes collections, etc.
11. Exception Frame
Exceptions may not be so important in the development of Java. Generally encountered anomalies, directly on the throw, or simply catch a deal after processing for the overall operation of the program has no significant impact. However, in enterprise-level design and development, the design and processing of the exception is often related to the overall robustness of the system. A good system of exceptions for developers, the processing should be unified, to avoid scattered around a lot of exception processing logic, for the system, the exception should be controllable, and is easy to operation, some anomalies, there should be a way to deal with, know how to operations, so although the exception frame is very simple, However, for the whole enterprise application development, exception handling is very important, to deal with the exception will need to understand the Java exception system.
This part needs to grasp the knowledge point is not many, mainly is:
Abnormal system:
Throwable
Exception
RuntimeException
Error
RuntimeException and general Exception differences, specific treatment methods, etc.
12.Java IO
IO in Java is not only the file read and write so simple, but also includes the socket network read and write, and so on all the input and output operations. For example, the standard HTTP request post content reading is also an output process, and so on ...
For Io,java not only provides basic input, output-related APIs, but also provides some simplified operation of reader, writer and other APIs, in some development (involving a large number of IO operation of the project) is also important, general daily development also involves (log, Read and write temporary files, etc.).
The main points of knowledge in this are:
Basic IO system: including InputStream, OutputStream, Reader/writer, file reading, various stream reading, etc.
The concept of NIO, specific usage patterns and usage scenarios
13. Multithreading Concurrency
Multithreading is generally considered a difficult piece in Java. Multithreading can effectively improve CPU utilization, improve overall system efficiency, especially in the case of a large number of IO operations blocked, but it is also a double-edged sword, if not used well, the system is not only a small increase, or no elevation, but also bring multi-threaded debugging and other issues.
There are a lot of content in multi-threading, just a brief explanation of the knowledge points that need to be mastered in Java in the initial use of multithreading, and later have the opportunity to describe in detail the usage scenarios of some advanced features separately.
Multithreading implementation and start-up
The difference between callable and runable
Syncrhoized, Reentrantlock of the respective characteristics and comparison
Thread pool
Future asynchronous way to get execution results
Concurrent Bag
Lock
..
14. Network
Java also provides APIs that can operate directly with the TCP protocol and UDP protocol. When you need to emphasize network performance, you can use TCP/UDP to communicate directly. You can see the usage of these related APIs in the source code that looks at Tomcat and so on. However, it is generally less likely to use TCP directly, using frameworks such as Mina and Netty for processing, since there is not much development involved in this area, so it is no longer exhaustive.
15. Time and date processing
For almost every application, the processing of the time and date is not the same, but the time-dependent API usage before JDK8 is not friendly. In that era, you can choose a time frame such as Joda. After the release of the JDK8, the new time API basically incorporates the benefits of other frameworks, which are already well-used.
For Java developers, it is necessary to use the API skillfully to handle time and date.
Specific knowledge points no longer listed, will be in the future to write a special article to summarize the use of time and date API in JDK8.
16.XML Parsing/JSON parsing
In fact, these two pieces of content is not j2se inside content, but in the daily development, and other program interaction, and configuration file interaction, more and more inseparable from the two forms of parsing.
But for a developer, the ability to understand some of the principles and methods of Xml/json specific parsing can help you better choose the right way to make your program more efficient and robust in every specific scenario.
XML: Need to understand the fundamentals of Dom parsing and sax parsing and their respective scenarios
JSON: You need to know some common JSON framework usage, such as Jackson, Fastjson, Gson, etc...
Use of 17.Maven
MAVEN is not content in Java, but Maven is revolutionary and has brought great convenience to Java development. From the introduction and management of dependencies, the updating and release of development processes, to the release of updates, the use of Maven can greatly simplify the complexity of the development process, thus saving a lot of time. It can be said that Maven has become the standard for Java developers. So I put Maven also as a Java developer for the basic prerequisite knowledge points. I'll put some more of my experience and skills on Maven in the future, and I'm not going to dwell on it.
18. Generics
This is a new concept introduced by JDK5, is actually a syntax sugar, in writing Java code, there will be a little convenience, general application or business development, only need to use simple, not necessarily the definition of generics such operations, but the development of some basic public components will be used, you can look at this part when needed , generally, as long as it is simple to use.
19. Labeling
was also introduced after the JDK5. Spring is an excellent framework, starting with XML as the standard configuration file. However, after the Spring3, especially after the rise of spring-boot, more and more respected the use of annotations to simplify the XML configuration file, for developers, can save a lot of XML configuration time. But the disadvantage is that the labels scattered in each class, unlike XML, can have a global understanding and management of all configurations, so there is no way to say that completely replace all the XML. For general developers, annotations can be used, and some public-build developers may need to understand the definition and implementation of annotations, and can look at them when they need them.
20.RMI
Remotemethodinvocation, the Java language-specific remote calling interface, use or relatively simple and convenient. However, in the case of cross-language, it is necessary to use other methods such as WebService to support. In general, the program does not need to use RMI, but can be used under certain circumstances, I am in a project, using RMI to the program remote start stop control.
21.JNI
Java Native Interface, which allows native interface methods to be called in Java, is typically used for calls to C + + code. It is important to note that the path problem of loading the So/dll file in Java is not complex, but it often takes more time to load the required local interface library.
The above is simply a brief introduction of my views and introductions to these basic Java knowledge points and technical points, which are derived from some of the lessons I have used in Java over the years, and I want to give some experience to people who have just touched Java, or who intend to develop from Java, Want to be able to learn and use Java more efficiently, avoid taking a detour and wasting precious time. There are some parts of the content that are not perfect, and will be added after the article. As a result of limited personal ability, of course, there will be some errors and omissions, welcome to correct, discuss together, together to complete this article, hope it can really help people in need.
Learn Java students pay attention to!!!
The learning process encountered any problems or want to acquire learning resources, welcome to join the Java Learning Exchange Group number:618528494 we learn java! together
Some suggestions for Java novice----Java knowledge point generalization (Java Basics section)