21 Java core technologies, you need to master!

  The purpose of writing this article is to summarize some of my experience and experience in using Java for so many years, and I hope to give you some experience so that everyone can learn and use Java better.
  The main content of this introduction is related to J2SE. In addition, I will introduce some J2EE-related content related to various frameworks in Java in the future.
  After so many years of Java development, combined with some of the usual interviews with Java developers, I think the main thing for J2SE is to master the following content.
  1. JVM-related
  For those who are new to Java, the JVM-related knowledge does not necessarily need to be understood very deeply. Just have a simple understanding of the concepts in it.
  But for a senior developer with more than 3 years of Java experience, it would be almost unacceptable not to have a JVM.
  The JVM is the basis for Java operation. It is hard to believe that anyone who does not know the JVM can eat the Java language thoroughly.
  When I interviewed developers with more than 3 years of Java experience, the JVM was almost a must-have question.
  Of course, the JVM is not the only interview question that determines the technical ability, but it can prove the level of java development ability.
  In the big category of JVM, I think the knowledge 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 each major version update of Java (needs a simple understanding) 2.   Java
  operation
This may seem very simple, who will not run the java program?
  However, in many cases, we just execute the java program through the IDE, how does the underlying IDE execute the java program? Many people do not understand.
  This knowledge point is the most basic Java developers need to master. The first one is definitely to teach you how to execute Java programs on the command line, but many people once forget Java and use the IDE, forget this. Too.
  Why do you emphasize to know this? After you know the purest way to start java, you can analyze how many directories were started at that time, how to name them, how to set parameters, and whether there are any missing, etc.
  This is helpful for you to solve those strange and possibly environment-related problems in real development.
  The knowledge to be mastered here is:
  ● javac compiles java files into class files
  ● use of java command, how to start java class with package on command line
  ● various paths involved in java program (classpath, java.library.path, Java running home directory, etc.)
  3. Data type
  There is not much to say about this, it is nothing more than the grasp of basic types and object types in Java.
  You can learn more about how JDK automatically converts, including boxing and unboxing, etc., and also pay attention to avoid the judgment of equal types after boxing.
  Main knowledge points:
  ● Basic types: int, long, float, double, boolean. . .
  ● Corresponding object type: conversion of Integer and other types to basic types, boxing and unboxing
  ● Object type: equals, hashcode
  ● Features of String type
  4. Object and instance
  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
  ● Inheritance: handle static actions, allocate memory space, variables are defined as initial values, from the base class -> Subclasses, handling initialization at the definition point, and implementing construction methods
  Points to note:
  ● Static properties, etc. are initialized from the base class-> subclasses
  ● Features related to the default parameterless constructor
  5. Access control
  This is also java One of the foundations of encapsulation features that need to be mastered is: public protected default private modification of class, method, and field.
  6. Flow control
  The foundation of Java flow control. Although some syntaxes are not necessarily very common, they all need to be understood and used in appropriate places.
  Need to master: if, switch, loop, for, while and other flow control syntax.
  7. The concept of object-oriented programming
  This is a core concept of java, and any java developer needs to master it.
  Many features or knowledge points in Java are related to the concept of java object-oriented programming.
  In my understanding, a good developer need not only understand these features (knowledge points) themselves.
  You also need to know how these objects are reflected in the concept of object-oriented programming in Java, which is more conducive to developers to master the Java development language and other object-oriented programming languages.
  Here is just a brief list. The main knowledge points include:
  ● Three major object-oriented features: encapsulation, inheritance, and polymorphism;
  ● Each definition concept, which features are reflected, and their respective use scenarios
  ● Static multi-dispatch, The concept of dynamic single dispatch
  ● The concept and use of overloading
  ● Inheritance: multiple implementations of interfaces, single inheritance of base classes
  ● Abstraction, abstract classes, interfaces
  ● Polymorphism: the concept and use of method coverage
  ● Interface callback
  8.
  static static properties in java It is also often used in daily development. You need to understand the usage related to the static keyword, and use it with other keywords, such as whether it can be used in conjunction with abstract, final and other keywords.
  The main need to master are:
  ● The definition and use of static properties, and how to initialize when the class is loaded
  ● The definition and use of static methods ● The definition and use of
  static classes
  ● The definition and initialization timing of static code blocks
  9. The basic knowledge
  here is mainly List some scattered knowledge points about java without systematic classification.
  It is also used in daily development. There is actually a lot of content in this piece. At present, I just summarized these here:
  including:
  ● equals
  ● hashcode
  ● tring / 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. You must be clear about the Java collection interview questions and answers organized here.
  But the knowledge here is not difficult, but it is best to understand the internal implementation of the collection, because it helps you choose a suitable framework to solve the problem in various scenarios, such as a collection of 1W elements, often It is easy to make the right choice by performing the judgment operation of contains and knowing the characteristics or internal implementation of the collection.
  The following content is included here (concurrency-related is not included):
  Collection framework system: basic Collection, Map
  specific collection implementation content, List, Set, Map specific implementation, internal structure, special methods, applicable scenarios and other
  collection related Usage of tool collections, etc.
  11. Exception framework
  exceptions may not be so valued in the development of java. The best practice of exception handling is explained in detail.
  Generally, if you encounter an exception, throw it directly, or catch it for a while, and it will not have a big impact on the overall operation of the program. However, in enterprise-level design and development, the design and handling of abnormalities are often related to the overall robustness of the system.
  For a good system, exceptions should be handled uniformly by developers to avoid a lot of exception handling logic. For the system, exceptions should be controllable and easy to operate and maintain. After some exceptions occur, There should be a coping method, know how to deal with operation and maintenance, so although the exception framework is very simple, but for the entire enterprise-level application development, exception handling is very important, to handle exceptions, you need to understand the exception system in Java.
  There are not many knowledge points to be mastered in this part, mainly:
  exception system:
  Throwable
  Exception
  RuntimeException

  The difference between   Error RuntimeException and general Exception, specific processing methods, etc.
  12.
  Java IO IO is not only as simple as reading and writing files in Java, but also includes socket network reading and writing and all other input and output operations. For example, the reading of Post content 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 simplified operations such as Reader and Writer APIs. Some developments (projects involving a lot of IO operations) are also very important, and are also involved in general daily development (logs, reading and writing temporary files, etc.).
  The main points of knowledge in this are: The
  basic IO system includes InputStream, OutputStream, Reader / Writer, file reading, various stream reading, etc., the concept of NIO, specific use methods and use scenarios.
  13. Multi-threaded concurrency
  multi-threading is generally considered a difficult part in Java.
  The use of multi-threading can effectively improve the CPU utilization rate and improve the overall system efficiency, especially in the case of a large number of IO operations blocked; the Java multi-thread interview questions and answers you have to sort out here must be clear.
  However, it is also a double-edged sword. If it is not used well, the system will not only improve little or not, but also bring problems such as debugging between multiple threads.
  There are many contents in multi-threading, just to briefly explain the knowledge points that need to be mastered in the initial use of multi-threading in Java. In the future, I will have the opportunity to introduce the use scenarios of some advanced features in detail. Reply to "Multithreading" in the Java technology stack public account to get a series of multithreading tutorials.
  ● Multithreaded implementation and start
  ● Callable and runable difference
  ● syncrhoized, reentrantLock their own characteristics and comparison
  ● thread pool
  to obtain the results of an asynchronous manner ● future
  ● concurrent package
  ● Lock
  14. The network
  Java is also provided that can directly manipulate the TCP protocol, UDP protocol API.
  In cases where network performance needs to be emphasized, TCP / UDP can be used for communication directly.
  You can see the usage of these related APIs in the source code of Tomcat and so on.
  However, it is generally rare to use TCP directly, and frameworks such as MINA and Netty will be used for processing. Because there is not much development involved in this aspect, it will not be listed in detail.
  15. Time and date processing
  For almost every application, the processing of time and date cannot be circumvented, but the usage of time-related APIs before JDK8 is not friendly.
  In that era, you can choose Joda and other time frames. After the release of JDK8, the new time API basically integrates the advantages of other frameworks and can be used directly.
  For Java developers, it is necessary to use the API to deal with the time and date.
  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
  In fact, these two pieces of content are not the contents of J2SE, but in daily development, interacting with other programs and interacting with configuration files are increasingly inseparable from parsing these two formats.
  However, for a developer, being able to understand the principles and methods of specific XML / JSON parsing will help you better choose the appropriate method in each specific scenario to make your program more efficient and more 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.
  17.
  Maven is not the content of Java in Maven, but maven is revolutionary, which brings great convenience to java development. You must be familiar with these 30 Maven commands.
  From the introduction and management of dependencies, the development process update and release output, 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 for java developers. So I take maven as a necessary knowledge point for Java developers.
  Reply to "Maven" in the Java technology stack public account to get the Maven series of tutorials, and I will put some of my experience and tips for using maven in the future. I won't go into details here.
  18. Generic
  This is a new concept that JDK5 started to introduce, in fact it is a syntactic sugar.
  When writing Java code, it will be a little convenient. General applications or business development only need to be simple to use, and operations such as defining generics are not necessarily used.
  However, some basic public components will be used for development. You can look at this part in detail when you need it. In general, you can simply use it.
  19. Annotations were
  also introduced after jdk5, and you must understand meta-annotations.
  Spring is an excellent framework, with XML as the standard configuration file from the beginning.
  However, after Spring3, especially after the rise of spring-boot, the use of annotations to simplify the xml configuration file is increasingly admired. For developers, it can save a lot of xml configuration time.
  But the disadvantage is that the annotations are scattered in various categories. Unlike XML, you can have a global understanding and management of all configurations, so there is no way to say that all XML will be completely replaced.
  For general developers, you will use annotations. Some public developers may need to understand the definition and implementation of annotations. You can look at them when you need them.
  20. RMI
  RemoteMethodInvocation, a remote calling interface unique to the Java language, is relatively simple and convenient to use, click here to learn more about the difference between RMI and RPC.
  However, when cross-language is needed, other methods such as webservice are needed to support it.
  Generally speaking, programs do not need to use RMI, but they can be used in specific situations. I use RMI in a project to control the remote start and stop of the program.
  21. JNI
  Java Native Interface, which allows Java to call native interface methods, is generally used for C / C ++ code calls.
  It should be noted that the path of loading the so / dll file in java is not complicated to call the interface itself, but often spends more time in whether the required local interface library is loaded.
  The above is just a brief introduction to some of my views and introductions on these java basic knowledge points and technical points.
  These contents are derived from some summary of my use of java over the years. There are still some areas where the content is not perfect, and will be added through future articles.

Guess you like

Origin www.cnblogs.com/525jik/p/12702566.html