Master these 21 Java core technical points, start with a salary increase of 5K, say goodbye to work copy and paste!

This article is to summarize some of the experience of using java for so many years, mainly related to some basic knowledge points of java. I hope to give you some experience, so that everyone can learn and use Java better. After so many years of Java development, as well as some experience in interviewing Java developers, I think the main thing about J2SE is to master the following content. At the same time, we also compiled a 283-page PDF document of the core knowledge of Java. Friends who need it can click: Click here ! Click this! , Code: csdn.
Insert picture description here

One, JVM related (including the characteristics of each version)

For those who are new to Java, the knowledge of JVM does not necessarily need to be deeply understood, but a simple understanding of the concepts in it is enough. But for a senior developer with more than 3 years of Java experience, it is almost unacceptable not to know the JVM.

JVM is the basis of java operation. It is hard to believe that people who don't know anything about JVM can fully understand the java language. When I was interviewing developers with more than 3 years of Java experience, JVM was almost a must-ask question. Of course, JVM is not the only interview question that determines technical ability, but it can prove the level of java development ability.

In the JVM category, 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 major versions of Java (need to understand briefly)

Two, Java operation (basic essential)

This may seem very simple. Who can run the java program? But many times, we just execute the java program through the IDE. How does the underlying IDE execute the java program? Many people don't understand.

This knowledge point is the most basic java developer needs to master. For beginners to learn java, the first one is definitely to teach you how to execute java programs on the command line, but once many people have learned java and used the IDE, they I forgot about this. Why is it important to know this? After knowing the purest Java startup method, you can analyze the number of directories that were started at the time when there is a problem with the startup, what is the name of the execution, what are the parameters, whether there is any missing, etc. This is conducive to your real development to solve those weird and possible environment-related problems.

The knowledge you need to master here are:

  • javac compiles java files into class files
  • How to use the java command and how to start the java class with package on the command line
  • The various paths involved in the java program (classpath, java.library.path, the main directory where java runs, etc.)

Three, data type

There is not much to say about this article, it is nothing more than the mastery of basic types and object types in Java. You can learn more about how to automatically convert the JDK, including boxing and unboxing, etc., and also pay attention to avoiding the judgment of type equality after boxing

Main knowledge points:

  • Basic types: int, long, float, double, boolean
  • Corresponding object type: conversion from Integer and other types to basic types, boxing and unboxing
  • Object type: equals, hashcode
  • Characteristics of String type

Four, objects and instances, the creation of objects

In this regard, developers need to understand the concept of class and instance and the difference between them, which is a foundation of java object-oriented features. The main knowledge points are:

The concept of Class and Instance;
The process of Instance creation:
①. No inheritance: allocate memory space, initialize variables, call constructor;
②. With inheritance: handle static actions, allocate memory space, variables are defined as initial values, from the base class- >Subclass, handle the initialization of the definition and execute the construction method;

Points to note: static properties, etc. are initialized from the base class -> subclass; the default non-parameter construction method related features.

Five, access control

This is also a basis of the Java packaging features, you need to master:

  • public protected default private Modification of class, method and field

Six, process control

The basics of Java flow control, although some syntax is not necessarily very common, but you need to understand and use them where appropriate.

Need to master: if, switch, loop, for, while and other flow control syntax

At the same time, I also sorted out some interview questions for 2020. Friends who need it can click: Click here ! Click this! , Code: csdn.

Insert picture description here

Seven, the concept of object-oriented programming

This is a core concept of java, which needs to be mastered for any java developer. Many features or knowledge points in Java are related to the concept of object-oriented programming in Java. In my understanding, a good developer not only needs to understand these characteristics (knowledge points) itself, but also needs to know how these objects are reflected in the concept of java object-oriented programming, which is more conducive to the developer to master java This development language, as well as other object-oriented programming languages. Here is just a brief list, the main knowledge points include:

  • Three object-oriented characteristics: encapsulation, inheritance, polymorphism; their respective definition concepts, what characteristics are reflected, and their respective usage scenarios
  • The concept of static multiple dispatch and dynamic single dispatch
  • The concept and use of overloading
  • Inheritance: multiple implementations of interfaces, single inheritance of base classes
  • Abstraction, abstract class, interface
  • Polymorphism: the concept and use of method coverage
  • Interface callback

Eight, Static

Static properties are also often used in daily development of java. You need to understand the usage related to the static keyword, and use it in conjunction with other keywords, such as whether it can be combined with keywords such as abstract and final.

The main things to master are:

  • The definition and use of static properties, and how to initialize the class when loading
  • Definition and use of static methods
  • Definition and use of static classes
  • Definition and initialization timing of static code blocks

Nine, basic knowledge points

Here are mainly some scattered, some java knowledge points that are not classified by the system. It is also used a lot in daily development. There is actually a lot of this piece of content, and it is only temporarily summarized here, including:

  • equals
  • hashcode
  • string/stringbuffer
  • final
  • finally
  • finalize

10. Collection framework

This is a part that needs to be mastered. For java development, it can be said that there is no need to use the collection framework. This is very important. But the knowledge points here are not difficult, but it is best to understand the internal implementation of the collection, because this will help you choose a suitable framework to solve the problem in various scenarios, such as a collection of 1W elements, often Performing the contains judgment operation, knowing the characteristics or internal implementation of the collection, it is easy to make the right choice.

The following content is included here (concurrency related is not included):

  • Collection framework system: basic Collection, Map
  • Specific collection implementation content, specific implementation of List, Set, Map, internal structure, special methods, applicable scenarios, etc.
  • Usage of collection-related tools, Collections, etc.

Eleven, abnormal framework

Exceptions may not be taken seriously in the development of java. Generally, when an exception is encountered, it is thrown directly, or after a random catch, it has no major impact on the overall operation of the program. However, in enterprise-level design and development, the quality of abnormal design and handling is often related to the overall robustness of the system. For developers, the exceptions of a good system should be handled uniformly to avoid a lot of exception handling logic scattered everywhere; for the system, exceptions should be controllable and easy to operate and maintain. After certain exceptions occur, There should be a way to deal with it and know how to handle it. So although the exception framework is very simple, exception handling is very important for the entire enterprise application development. To handle exceptions well, you need to understand the exception system in Java.

There are not many knowledge points that need to be mastered in this part, mainly:
abnormal system:

  • Throwable
  • Exception
  • RuntimeException
  • Error
  • The difference between RuntimeException and general Exception, specific handling methods, etc.

12. Java IO

IO is not only as simple as file reading and writing in java, but also includes all input and output operations such as socket network reading and writing. For example, reading the content of Post in a standard HTTP request is also an output process, etc...

For IO, Java not only provides basic Input and Output-related APIs, but also provides some apis such as Reader and Writer that simplify operations. It is also very important in certain developments (projects involving a large number of IO operations). Generally, in daily development It will also involve (logs, reading and writing of temporary files, etc.).
The main knowledge points in this are:
basic IO system: including InputStream, OutputStream, Reader/Writer, file reading, various stream reading, etc.

NIO concept, specific usage and usage scenarios

Thirteen, multi-threaded concurrency

Multithreading is generally considered a difficult part in Java. Multi-threading can effectively increase the CPU usage rate and improve the overall system efficiency, especially in the case of a large number of IO operations blocked; but it is also a double-edged sword. If it is not used well, the system will not only improve slightly, or There is no improvement, and it will also cause problems such as debugging between multiple threads.

There are a lot of content in multi-threading, just briefly explain the knowledge points that need to be mastered in the initial use of multi-threading in Java, and I will have the opportunity to separately introduce some advanced features in detail in the future.

  • Implementation and startup of multithreading
  • The difference between callable and runable
  • The characteristics and comparison of syncrhoized and reentrantLock
  • Thread Pool
  • future asynchronous way to get the execution result
  • concurrent package
  • lock…

14. Network

Java also provides APIs that can directly manipulate TCP and UDP protocols. When network performance needs to be emphasized, TCP/UDP can be used directly for communication. You can see the usage of these related APIs in the source code of Tomcat, etc. However, in general, TCP is rarely used directly, and frameworks such as MINA and Netty are used for processing. Because there is not much development involved in this area, it will not be listed in detail.

15. Time and date processing

For almost every application, the processing of time and date cannot be bypassed, but the usage of time-related API before JDK8 is not friendly. In that era, time frames such as Joda could be chosen. After the release of JDK8, the new time API basically incorporates the advantages of other frameworks and can already be used directly.

For Java developers, it is necessary to skillfully use the API to deal with time and date.

The specific knowledge points are no longer listed, and a special article will be written later to summarize the usage of the time and date API in JDK8.

16. XML parsing / JSON parsing

In fact, these two pieces of content are not the content in J2SE, but in daily development, interaction with other programs and configuration files are increasingly inseparable from the analysis of these two formats.

However, for a developer, being able to understand some of the principles and methods of specific XML/JSON parsing will help you better choose the right way for you in each specific scenario to make your program more efficient and robust .

  • XML: Need to understand the basic principles of DOM parsing and SAX parsing and their respective applicable scenarios
  • JSON: Need to understand the usage of some common JSON frameworks, such as Jackson, FastJson, Gson, etc.

Seventeen, the use of Maven

Maven is not the content of Java, but Maven is revolutionary and brings great convenience to Java development. From the introduction and management of dependencies, the update and release of the development process, and even the version update, using maven can greatly simplify the complexity of the development process, thereby saving a lot of time. It can be said that maven has become the standard configuration for java developers. So I regard maven as a basic knowledge point for java developers. I will put some of my experience and skills in the use of maven in the future, so I won't go into details here.

Eighteen, generic

This is a new concept introduced at the beginning of JDK5. It is actually a syntactic sugar. It will be a little convenient when writing java code. For general application or business development, you only need to use it simply, not necessarily using operations such as defining generics. However, some basic public components will be used in the development. You can read this part carefully when you need it. In general, you can simply use it.

19. Labeling

It was also introduced after jdk5. Spring is an excellent framework. XML was used as the standard configuration file from the beginning. However, after Spring 3, especially after the rise of spring-boot, the use of annotations to simplify xml configuration files has become more and more popular. For developers, it can save a lot of time for xml configuration. But the disadvantage is that the annotations are scattered in various classes, unlike xml, which can have a global understanding and management of all configurations, so there is no way to say that it will completely replace all xml. For general developers, just use annotations. Developers of some public organizations may need to understand the definition and implementation of annotations. You can look at them when you need them.

Twenty, RMI

RemoteMethodInvocation, the unique remote invocation interface of Java language, is relatively simple and convenient to use. However, when cross-language is required, other methods such as webservice are needed to support it. Generally speaking, the program does not need to use RMI, but it can be used under specific circumstances. I used RMI to control the remote start and stop of the program in a project.

21. JNI

Java Native Interface can allow the native interface method to be called in Java, which is generally used for calling C/C++ code. It should be noted that the path problem of loading the so/dll file in java is not complicated to call the interface itself, but it often takes a lot of time to load the required local interface library.

The above is just a brief introduction to some of my views and introductions of these basic knowledge and technical points of Java. These contents are derived from some of the summaries of my use of Java over the years. I hope that I will be new to Java or plan to develop from Java. People have some experience, hoping to learn and use java more efficiently, avoiding detours and wasting precious time.

Free Java architecture learning materials are also provided. The learning technology content includes: Spring, Dubbo, MyBatis, RPC, source code analysis, high concurrency, high performance, distributed, performance optimization, microservice advanced architecture development, etc.
Friends in need can click: click this! Click this! , Code: csdn.

There are also Java core knowledge points + a full set of architect learning materials and videos + first-line interview books + interview resume templates can be obtained + Alibaba Meituan Netease Tencent Xiaomi Iqiyi Kuaishou Bilibili interview questions + Spring source code collection + Java architecture Practical e-books.
Insert picture description here

Guess you like

Origin blog.csdn.net/weixin_48011329/article/details/108647536