The purpose of writing this article is to summarize some of my experiences in using Java over the years, mainly related to some basic Java knowledge points, so I also hope to share it with Java programmers who have just started and prospective novices who intend to enter the Java development industry. I hope to give you some experience and let you learn and use Java better.
The main content of this introduction is the J2SE-related part. In addition, we will introduce some J2EE-related content related to each framework in Java in the future.
After so many years of Java development and combined with some experience in interviewing Java developers, I think the main thing for J2SE is to master the following content.
1. JVM related (including features of each version)
For those who are just getting involved in Java, JVM-related knowledge does not necessarily need to be deeply understood, so you can have a simple understanding of the concepts in it. However, for a senior developer with more than 3 years of Java experience, it is almost unacceptable to not know JVM.
As the basis for Java operation, it is hard to believe that people who don’t know JVM at all can fully understand the Java language. When I interviewed 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 the quality of technical capabilities, but it can prove the level of Java development capabilities.
In the JVM category, I think the knowledge that needs to be mastered is:
JVM memory model and structure
GC principle, performance tuning
Tuning: Thread Dump, analyze memory structure
class binary bytecode structure, class loader system, class loading process, instance creation process
Method execution process
New features provided by various major version updates of Java (requires a simple understanding)
2. Java operation (basic essentials)
This may be very simple to see. Who can't run a Java program? But many times, we just execute java programs through the IDE. How does the underlying IDE execute java programs? Many people don't understand.
This knowledge point is the most basic thing that Java developers need to master. When you beginners, the first thing is to teach you how to execute Java programs on the command line, but many people forget about this once they have finished learning Java and use the IDE. Why do you emphasize knowing this? After you know the purest way of starting Java, you can analyze the number of directories started at that time, how to execute naming, what parameters are, whether there are any missing, etc. when there is a problem with startup. This will help you to solve strange possible environment-related problems in real development.
The knowledge you need to master here is:
javac compiles java file as class file
Use of java commands, how to start java class with package on the command line
The various paths involved in the java program (classpath, java.library.path, home directory where java runs, etc.)
3. Data Type
There is nothing much to say about this article, it is nothing more than mastering the basic types and object types in Java. You can learn more about how JDK automatically converts, including packing and unboxing, etc. You should also pay attention to avoid the judgment of equal types after packing.
Main knowledge points:
Basic types: int, long, float, double, boolean, . . .
Corresponding object types: Integer and other types to basic types conversion, packing and unboxing
Object type: equals, hashcode
Features of String Type
4. Objects and instances, object creation
In this regard, developers need to understand the concepts of class and instance and the differences between them, which is a basis for the object-oriented features of Java. The main knowledge points are:
Class and Instance concepts
Instance creation process:
1. No inheritance: allocate memory space, initialize variables, and call constructors
2. Inheritance: handles static actions, allocates memory space, defines variables as initial values, handles initialization at the definition, and executes the constructor
Points to note:
Static properties, etc. are initialized from base class->subclasses
Features related to the default parameterless construction method
5. Access control
This is also a basis for Java encapsulation features, and what needs to be mastered are:
The modification effect of public protected default private for class, method, and field
6. Process control
The basics of Java process control, although some syntaxes are not necessarily commonly used, they need to be understood and used in the right places.
What needs to be mastered are:
Syntax for process control such as if, switch, loop, for, while
7. The concept of object-oriented programming
This is a core concept of java that needs to be mastered by 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 features (knowledge points) themselves, but also needs 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 development language of Java and other object-oriented programming languages. I just briefly listed here, and the main knowledge points include:
Three major object-oriented features: encapsulation, inheritance, and polymorphism; their respective definition concepts, what are their characteristics reflected, and their respective usage scenarios
The concept of static multi-distribution and dynamic single-distribution
Concept and use of overloading
Inheritance: multiple interface implementations, single base class inheritance
Abstract, abstract class, interface
Polymorphism: Concept and use of method coverage
Interface callback
8. Static
Static attributes are also frequently used in daily Java development. You need to understand the usage related to static keywords, and also use them in conjunction with other keywords, such as whether they can be used in conjunction with keywords such as abstract and final.
The main things to master are:
Definition of static properties, usage, 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
9. Basic knowledge points
Here we mainly list some scattered Java knowledge points that are not systematically classified. It is also used a lot in daily development. There is actually a lot of content in this area. At present, I have only summarized these for the time being here:
Including:
equals , hashcode , string/stringbuffer , final , finally , finalize
10. Collection Framework
This is a part that needs more mastery. It can be said that there is no need for collection frameworks without using them. This is very important. However, the knowledge points here are not difficult, but it is best to understand the internal implementation method for collections, because this will help you choose the appropriate framework in different scenarios to solve the problem. For example, if you have a set of 10,000 elements, you often need to perform contains judgment operations. If you know the characteristics of the collection or internal implementation, it is easy to make the correct choice.
The following content is included here (concurrency correlation is not included):
The system of collection framework: basic collection, map
Contents of specific set implementations, List, Set, Map specific implementations, internal structures, special methods, applicable scenarios, etc.
Usage of collections, etc.
11. Exception framework
Exceptions may not be taken so seriously in Java development. Generally, when encountering exceptions, they will be thrown directly, or simply catch them and process them, and will not have any major 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 developers, the handling of exceptions in a good system should be unified and avoid a lot of exception handling logic scattered everywhere; for systems, exceptions should be controllable and easy to operate and maintain. After some exceptions appear, there should be a way to deal with them and know how to operate and maintain. Therefore, although the exception framework is very simple, for the entire enterprise-level application development, exception handling is very important. To handle exceptions well, you need to understand the exception system in Java.
There are not many knowledge points to master in this part, mainly:
Abnormal system:
Throwable
Exception
RuntimeException
Error
The difference between RuntimeException and general Exception, specific processing methods, etc.
12.Java IO
IO is not only simple in Java to read and write files, but also includes all input and output operations such as reading and writing of socket networks. For example, reading Post content in standard HTTP requests is also an output process, etc...
For IO, Java not only provides basic Input and Output-related APIs, but also provides some simplified operation Reader and Writer APIs, which are also very important in some developments (projects involving a large number of IO operations). It will also involve (logs, reading and writing temporary files, etc.) in daily development.
The main knowledge points here are:
Basic IO system: including InputStream, OutputStream, Reader/Writer, file reading, various stream reading, etc.
The concept of NIO, specific usage methods and usage scenarios
13. Multi-threaded concurrency
Multithreading is a relatively difficult part in Java. If multi-threading is used properly, it can effectively improve the CPU usage rate and improve the overall system efficiency, especially when there are a large number of IO operations blocking; but it is also a double-edged sword. If it is not used well, the system will not only not be greatly improved or not improved, but will also bring about problems such as debugging between multiple threads.
There are many contents in multithreading. I just briefly explain the knowledge points that need to be mastered in Java in the initial use of multithreading. In the future, if you have the opportunity to introduce some advanced features in detail, you will have a detailed introduction to the usage scenarios of some advanced features.
Multithreaded implementation and startup
Difference between callable and runable
syncrhoized, reentrantLock's respective features and comparisons
Thread pool
Get execution results asynchronously
concurrent package
lock
..
14. Network
Java also provides APIs that can directly operate the TCP protocol and UDP protocol. When it is necessary to emphasize network performance, communication can be directly used with TCP/UDP. You can see the usage of these related APIs when viewing the source code of Tomcat and other. However, generally, TCP is rarely used directly, and frameworks such as MINA and Netty are used for processing. Because there is not much development in this area, I will not list them in detail.
15. Time and date processing
For almost every application, time and date processing cannot be avoided, but the usage of time-related APIs 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 integrates the advantages of other frameworks and can be used directly.
For Java developers, they need to be proficient in using APIs to deal with time and dates.
The specific knowledge points will not be listed anymore. I will write a special article in the future to summarize the usage of the time and date API in JDK8.
16.XML parsing/JSON parsing
In fact, neither of these two contents is the content in J2SE, but in daily development, interaction with other programs and configuration files is increasingly inseparable from the parsing of these two formats.
However, for a developer, being able to understand some principles and methods of XML/JSON specific parsing will help you better choose the right way for you in each specific scenario to make your program more efficient and robust.
XML: You need to understand the basic principles of DOM parsing and SAX parsing and their respective applicable scenarios
JSON: You need to understand the usage of some commonly used JSON frameworks, such as Jackson, FastJson, Gson, etc. .
17.Using Maven
Maven is not a content in Java, but maven is revolutionary and brings great convenience to Java development. From the introduction and management of dependencies, the updates and releases of development processes, and even version updates, using maven can greatly simplify the complexity in 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 also regard maven as a basic knowledge point for a Java developer. I will add some of my experiences and skills in using maven in the future, so I won’t go into details here.
18. Generics
This is a new concept introduced by JDK5. It is actually a syntactic sugar. It will be a little convenient when writing Java code. Generally, for the development of applications or business, it only needs to be used simply, and it may not necessarily be used to define generics. However, some basic public components will be used. You can take a closer look at this part when needed. Generally, it can be used simply.
19. Marking
It was also introduced after jdk5. Spring is an excellent framework, and it started with XML as the standard configuration file. However, after Spring3, especially after the rise of spring-boot, it is increasingly recommended to use annotations to simplify the XML configuration file. For developers, it can save a lot of time on XML configuration. However, the disadvantage is that the annotation is scattered in various classes. Unlike xml, it can have a global understanding and management of all configurations, so there is no way to completely replace all xml. For ordinary developers, you can just use annotations. Some developers with public components may need to understand the definition and implementation of annotations, and you can take a closer look when you need them.
20.RMI
RemoteMethodInvocation is a remote call interface unique to Java language, and it is relatively simple and convenient to use. However, when cross-language situations, 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 am in a project, using RMI to control the program's remote start and stop.
21.JNI
Java Native Interface allows local interface methods 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 my views and introductions on these basic java knowledge points and technical points. These contents are all derived from some summary of my use of java over the years. I hope to give some experience to those who have just been exposed to Java or intend to develop from Java. I hope to learn and use java more efficiently and avoid wasting valuable time. There are still some incomplete content in this, and they will be added through future articles. Due to limited personal abilities, of course there will be some errors and omissions. Welcome to correct me, discuss together, and improve this article together, hoping that it can truly help people in need.
The above summary of Java knowledge points - some suggestions for Java beginners (must read for beginners) are all the content I share with you. I hope you can give you a reference and I hope you can support Wulin.com more.