Some suggestions for beginners of Java ---- Java knowledge points (Java basics), some suggestions ---- java

Source: Internet
Author: User

Some suggestions for beginners of Java ---- Java knowledge points (Java basics), some suggestions ---- java

 

The purpose of this article is to summarize some of my experiences in using java over the years, mainly related to some basic java knowledge points, therefore, I also hope to share with the beginners of Java programmers and prospective beginners who intend to develop Java programs. I hope to give you some experience and help you better learn and use Java.

The main content of this introduction is the J2SE-related content. In addition, we will introduce some J2EE-related content and the content related to various Java frameworks in the future.

After so many years of Java Development and some experience of interviewing Java developers, I think the main focus of J2SE is to master the following content.

 

1. JVM-related (including features of each version)

For those who have just been familiar with Java, JVM-related knowledge does not need to be fully understood. You can simply understand the concepts in this article. However, for a senior developer with more than three years of Java experience, no JVM is almost unacceptable.

As the basis for running java, it is hard to believe that people who are not familiar with JVM can thoroughly understand the java language. When I interviewed developers with more than three years of Java experience, JVM was almost a required 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 following knowledge is required:

JVM Memory Model and Structure

GC principle, Performance Tuning

Optimization: Thread Dump to analyze the memory structure

Class binary bytecode structure, class loader System, class loading process, instance creation process

Method Execution Process

New features provided by major Java version updates (easy to understand)

 

2. Java running (essential)

This article may seem very simple. Who will not run the java program? However, in many cases, we only use IDE To execute java programs. How does the underlying IDE execute java programs? Many people do not understand it.

This knowledge point is required by the most basic java developers. For beginners of java, the first one is to teach you how to execute java programs in the command line, but once many people finish learning java, when IDE is used, I forget this. Why do you need to know this? After you know the pure startup method of java, you can analyze the number of started directories, how to execute the name, and how to set the parameters when the startup fails, whether there are missing or not. This helps you solve environment-related problems that are strange.

The following knowledge is required:

Javac compiles java files as class files

How to start the java class with package in the command line

The paths involved in the java program (classpath, java. Library. Path, main directory running in java, etc)

 

3. Data Type

There is nothing to say about this article. It is nothing more than the basic types and object types in Java. You can learn more about how to automatically convert JDK, including packing and unpacking, and avoid the judgment of equal types after packing.

Key knowledge points:

Basic types: int, long, float, double, boolean ,...

Corresponding object types: Convert Integer and other types to basic types, packing and unpacking

Object Type: equals, hashcode

Features of the String type

 

4. Object and instance, object Creation

In this regard, developers need to understand the concepts and differences between class and instance, which is a basis for java object-oriented features. Key knowledge points include:

Concepts of Class and Instance

Instance creation process:

1. No inheritance: allocates memory space, initializes variables, and CALLS constructors.

2. Inheritance: handles static actions, allocates memory space, defines variables as initial values, starts from the base class-> subclass, processes initialization at the definition, and executes the constructor.

Notes:

Static attributes and other class

Features related to the construction method without parameters by default

 

5. Access Control

This is also a basis for java encapsulation features, which need to be mastered:

Public protected default private modifier for class, method, field

 

6. Process Control

The basis of Java Process Control, although some syntaxes are not necessarily very commonly used, must be understood and used in appropriate places.

You need to know the following:

If, switch, loop, for, while and other process control syntax

 

7. Concepts of Object-Oriented Programming

This is a core concept of java and must be mastered by any java developer. Many features or knowledge points in Java are related to java object-oriented programming concepts. In my understanding, a good developer not only needs to understand these features (knowledge points), but also needs to know how these objects are embodied in the java object-oriented programming concept, this helps developers master the java development language and other object-oriented programming languages. Here is a simple list. The main knowledge points include:

Three main features of object-oriented: encapsulation, inheritance, and polymorphism; their respective definition concepts, which are embodied in their respective Use Cases

Concept of static multi-assignment and dynamic single-assignment

Concept and usage of heavy load

Inheritance: Multiple implementations of interfaces and single inheritance of basic classes

Abstract, abstract class, Interface

Polymorphism: Concepts and usage of method coverage

Interface callback

 

8. Static

Static attributes are also frequently used in routine java Development. You need to know the usage related to static keywords and use them with other keywords, such as whether they can be used together with abstract, final, and other keywords.

You need to know the following:

Static attribute definition, usage, and initialization during class loading

Definition and use of static methods

Definition and use of static classes

Definition and initialization time of static code blocks

 

9. Basic knowledge points

Here we mainly list some scattered java knowledge points that are not classified by the system. It is also used in daily development. There are still a lot of content in this section. At present, we have summarized these items here:

Including:

Equals, hashcode, string/stringbuffer, final, finally, finalize

 

10. Collection framework

This is a part that requires more control. For java development, it can be said that no collection framework is used, which is very important. However, the knowledge points here are not difficult, but it is best to understand the internal implementation methods for the collection, because this helps you select the appropriate framework in different scenarios to solve the problem, for example, if there is a set of elements, you often need to perform the contains judgment operation. Knowing the characteristics or internal implementation of the Set makes it easy to make the right choice.

The following content is included (not included in concurrency ):

Collection framework system: basic Collection, Map

Specific Set implementation content, List, Set, Map implementation, internal structure, special methods, applicable scenarios, etc.

Collection-related tool Collections usage

 

11. Exception framework

Exceptions may not be so important in java development. If an exception occurs, directly throw it, or catch it at will, it has no major impact on the overall running of the program. However, in enterprise-level design and development, abnormal design and handling are often related to the overall robustness of the system. For developers, the handling of exceptions of a good system should be unified to avoid a lot of exception handling logic scattered everywhere. For the system, exceptions should be controllable and easy to operate and maintain, after some exceptions occur, there should be countermeasures and know how to operate and maintain them. Although the exception framework is very simple, exception handling is very important for enterprise-level application development, to handle exceptions, you need to understand the exception system in Java.

There are not many knowledge points to master in this part, mainly as follows:

Abnormal system:

Throwable

Exception

RuntimeException

Error

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

 

12. Java IO

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

For IO, Java not only provides basic Input and Output related APIs, but also provides some simplified operations such as Reader and Writer APIs. In some development (projects involving a large number of IO operations) it is also very important. It will also be involved in routine development (logs, read/write of temporary files, etc ).

The knowledge points here mainly include:

Basic IO systems: including InputStream, OutputStream, Reader/Writer, file reading, various stream reading, etc.

NIO concept, specific usage and Use Cases

 

13. multi-thread concurrency

Multithreading is generally considered difficult in Java. Multithreading can effectively improve cpu usage and overall system efficiency, especially when many IO operations are blocked. However, multithreading is also a double-edged sword, or there is no improvement, and there will be issues such as debugging between multiple threads.

There are a lot of content in multithreading, just a brief description of the knowledge points that need to be mastered in Java's preliminary use of multithreading. In the future, I will have the opportunity to introduce some advanced features separately.

Multi-thread implementation and startup

Differences between callable and runable

Syncrhoized and reentrantLock features and Comparison

Thread Pool

Future asynchronously retrieves execution results

Concurrent package

Lock

..

 

14. Network

Java also provides APIs that can directly operate the TCP and UDP protocols. When network performance needs to be emphasized, you can directly use TCP/UDP for communication. You can view the usage of these APIs in the source code such as Tomcat. However, TCP is rarely used directly, and a framework such as MINA and Netty will be used for processing. because there are not many development projects involved in this aspect, they will not be listed in detail.

 

15. Date Processing

For almost every application, the processing of time and date cannot be bypassed, but the time-related API usage before jdk8. In that era, you can choose time frameworks such as Joda. After the release of JDK 8, the new time API integrates the advantages of other frameworks and can be used directly.

Java developers need to skillfully use APIs to process time and date.

I will write a special article later to summarize the usage of the time and date API in JDK 8.

 

16. XML parsing/JSON Parsing

In fact, neither of these two content is in J2SE, but in daily development, interaction with other programs and configuration files is increasingly inseparable from parsing these two formats.

However, a developer can understand the principles and methods of parsing XML/JSON, it helps you better select the appropriate method in each specific scenario to make your program more efficient and robust.

XML: You need to understand the basic principles and application scenarios of DOM parsing and SAX parsing.

JSON: You need to know the usage of common JSON frameworks, such as Jackson, FastJson, and Gson ..

 

17. Use of Maven

Maven is not the content in Java, but maven is revolutionary and brings great convenience to java development. From the introduction and Management of Dependencies, the update and release of development processes, and even version updates, maven can greatly simplify the complexity of the development process, thus saving a lot of time. Maven has become a standard for java developers. Therefore, I use maven as a basic knowledge point for java developers. I will put some of my experiences and skills on maven in the future, so I will not elaborate on them here.

 

18. Generic

This is a new concept introduced at the beginning of JDK 5. It is actually a syntactic sugar. It is a little convenient to compile java code. For general applications or business development, it only needs to be simple to use, operations such as defining generics may not be used, but some basic public components will be used for development. You can take a closer look at this part as needed. In general, you can simply use it.

 

19. Annotation

It was introduced after JDK 5. Spring is an excellent framework. At first, xml was used as the standard configuration file. However, after Spring3, especially after the rise of spring-boot, annotations are becoming more and more popular to simplify xml configuration files. for developers, saving a lot of time for xml configuration. However, the disadvantage is that labels are scattered in various classes. Unlike xml, labels can have a global understanding and management of all configurations, so there is no way to replace all the xml. Generally, developers can use tags. Some public-built developers may need to understand the definition and implementation of tags, so they can take a closer look at the specific needs.

 

20. RMI

RemoteMethodInvocation, a Java-specific Remote Call interface, is easy to use. However, in cross-language scenarios, webservice and other methods are required. Generally, the program does not need to use RMI, but it can be used in specific cases. 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 local Interface methods. It is generally used for Calling C/C ++ code. Note that the path of the so/dll file to be loaded in java is not complex, but it often takes a lot of time to call the interface.

 

The above is just a brief introduction of some of my views and introductions on these basic java knowledge points and technical points, all of which are derived from some of my summaries of using java over the years, I hope to give some experiences to people who are new to Java or who are planning to develop Java, so as to learn and use java more efficiently, so as to avoid wasting valuable time on detours. Some of the content is incomplete and will be added through later articles. Due to my limited personal ability, of course, there will be some mistakes and omissions. please correct me and discuss them together to improve this article. I hope it can help people who need it.

 

Related Article

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.