Java Knowledge Points Summary-some suggestions to the Java novice (novice must SEE) _java

Source: Internet
Author: User
Tags exception handling inheritance time and date

The purpose of this article is to sum up some of the experiences of using Java for so many years. It is mainly related to some Java basics, so I would like to share it with the novice Java programmers and would-be beginners who are going into the Java development business, hoping to give you some experience, Can make people learn and use Java better.

The main content of this presentation is related to J2SE, and in the future, we will introduce some of the relevant content of Java-EE related to the framework.

After so many years of Java development, as well as the combination of the usual interview with Java developers experience, I think the main aspect of J2SE is to master the following content.

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

For those of you who have just come in contact with Java, JVM-related knowledge does not need to be understood very well, there is a simple understanding of the concept. But for a senior developer with more than 3 years of Java experience, the JVM is almost unacceptable.

The JVM is the foundation of Java operations and it's hard to believe that people who don't know anything about the JVM can eat the Java language very well. When I was interviewing developers with more than 3 years of Java experience, the JVM was almost a question to ask. Of course, the JVM is not the only interview problem that determines the technical capability, but it can support the level of Java development capabilities.

In the broad class of JVMs, I think the knowledge that needs to be mastered is:

JVM memory model and structure

GC Principle, performance tuning

Tuning: Thread Dump, analyzing memory structure

Class binary byte code structure, class loader system, class loading process, instance creation process

Method Execution procedure

New features provided by various major versions of Java (need to be simple to understand)

2. Java running (Basic prerequisites)

This may look very simple, Java program running who will not? But very often, we simply execute Java programs through the IDE, and how does the underlying IDE execute Java programs? Many people do not understand.

This knowledge point is the most basic Java developers need to master, beginners Java, the first is certainly taught you how to execute Java programs on the command line, but many people once the Java finished, the IDE used, forget this. Why emphasize to know this, know the Java most pure startup way, you can start when the problem, to analyze how many directories started, how to execute naming, parameters, whether there are missing. This will help you to really develop and solve the strange and environment-related problems.

The knowledge that needs to be mastered here is:

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 Java programs involve (Classpath, Java. Library Path, Java running home directory, etc.)

3. Data type

This is not much to say, nothing more than the basic types of Java and the mastery of object types. You can learn more about how to automate the conversion of the JDK, including the boxed unboxing, and to avoid the same type of judgment after boxing

Main Knowledge Points:

Basic type: int, long, float, double, Boolean, ...

Corresponding object type: Integer and other types to the basic type of conversion, boxing and unboxing

Object type: Equals, hashcode

Character of String type

4. Objects and instances, creation of objects

In this context, developers need to understand the concepts of class and instance and the differences between them, which is a basis for Java object-oriented features. The main knowledge points are:

The concept of class and Instance

Instance the process created:

1. No inheritance: allocating memory space, initializing variables, calling constructors

2. Inheritance: Handles static actions, allocates memory space, defines variables as initial values,-> subclasses from base classes, handles initialization of definitions, executes construction methods

Points to note:

Static properties are initialized from the base class-> subclass

Attributes associated with the default parameterless construction method

5. Access control

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

Public protected default private for class, method, field cosmetic effect

6. Process Control

The basics of Java process Control, although some grammars are not necessarily very common, need to be understood and used in the right place.

What you need to know is:

If, switch, loop, for, while flow control syntax

7. The concept of object-oriented programming

This is a core concept of Java that requires mastery by any Java developer. Many of the features in Java, or knowledge points, are related to Java object-oriented Programming concepts. In my understanding, a good developer not only needs to understand these features (knowledge points) themselves, but also need to know how these objects in the Java object-oriented Programming concept is reflected, so that more useful for developers to master the Java Development language, as well as other object-oriented programming language. Here is a brief list of the main points of knowledge include:

Object-oriented three main characteristics: encapsulation, inheritance, polymorphism; Individual definition concepts, what are the features embodied, the respective use of the scene

The concept of static multiple dispatch and dynamic single dispatch

The concept and use of overloading

Inheritance: Interface multiple implementations, base class single inheritance

Abstract, abstract class, interface

Polymorphism: The concept of method coverage and its use

Interface callback

8. Static

Static properties are also used frequently in Java daily development to understand the usage associated with the static keyword, as well as with other keywords, such as whether it can be used in conjunction with abstract, final, and other keywords.

The main needs to master are:

Definition of static properties, use, and how classes are initialized when loaded

Definition and use of static methods

Definition and use of static classes

Definition and initialization time of static code block

9. Basic Knowledge points

Here is a list of 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 in fact there are a lot of, currently only temporarily summed up these several here:

Included are:

Equals, Hashcode, String/stringbuffer, final, finally, finalize

10. Collection Framework

This is a part of the need to learn more, do Java development, you can say that there is no need to assemble the framework, which is very important. But the knowledge here is not difficult, but for the collection it is best to understand the internal implementation, because this helps you to choose the appropriate framework in various scenarios to solve the problem, such as a set of 1W elements, often to do contains judgment operations, know the characteristics of the collection or internal implementation, It's easy to make the right choice.

This includes the following (concurrency related is not included):

System of the Set frame: Basic collection, Map

Specific set implementation of the content, List, set, MAP specific implementation, internal structure, special methods, applicable scenarios

Use of collection-related tool class collections, etc.

11. Anomaly Framework

Exceptions may not be as important in Java development as they are. Generally encountered anomalies, directly on the throw, or just catch a bit after processing for the overall operation of the program has no big impact. However, in enterprise-level design and development, the exception of the design and treatment of good or bad, often related to the overall robustness of the system. The exception of a good system for developers, processing should be unified to avoid a lot of exception handling logic scattered everywhere; for the system, the exception should be controllable, and is easy to transport, some anomalies, there should be a way to deal with, know how to Operation dimension processing, so although the exception framework is very simple, But for the enterprise-wide application development, exception handling is very important, dealing with the exception needs to understand the exception system in Java.

This part of the need to master the knowledge point is not much, mainly is:

Abnormal system:

Throwable

Exception

RuntimeException

Error

The difference between runtimeexception and general Exception, 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 reading and writing, and so on all the input and output operations. For example, the content of post in a standard HTTP request is read as a process of output, etc.

For Io,java not only provides basic input, output-related APIs, but also provides some simplified operation of the reader, writer and other APIs, in some development (involving a large number of IO operations) is also important, in general day-to-day development will involve (log, Temporary file reading and writing, etc.).

The main points of knowledge in this are:

Basic IO Systems: Includes InputStream, OutputStream, reader/writer, file reads, various stream reads, etc.

The concept of NIO, the specific use and use of the scene

13. Multithreading Concurrency

Multithreading is commonly considered a difficult piece in Java. Multithreading can be used to effectively improve the CPU utilization rate, improve overall system efficiency, especially in the case of a large number of IO operations blocking; but it is also a double-edged sword, if not used well, the system is not only to promote small, or not to upgrade, but also bring multiple threads between debugging and so on.

There are a lot of content in multiple threads, just a simple description of Java in the initial use of multithreading needs to grasp the knowledge points, and then have the opportunity to detail some of the advanced features of the use of the scene.

Implementation and startup of multithreading

The difference between callable and runable

Syncrhoized, Reentrantlock and comparison of their respective characteristics

Thread pool

Future asynchronous way to get execution results

Concurrent Bag

Lock

..

14. The Network

Java also provides APIs that can directly manipulate TCP protocols and UDP protocols. When you need to emphasize network performance, you can communicate directly using TCP/UDP. You can see the usage of these related APIs in the source code for Tomcat and so on. But generally also relatively few direct use TCP, will use such as Mina, Netty such a framework to deal with, because this aspect of development involves little, so no longer detailed list.

15. Time and date processing

Time and date processing is not a JDK8 for almost every application, but the API usage before the time is not friendly. In that era, you can choose Joda time frame. After the release of JDK8, the new time API basically blends the advantages of other frameworks and is already well used directly.

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

Specific knowledge points no longer listed, will later write a special article to summarize the JDK8 time and date API usage.

16.XML Parsing/JSON parsing

In fact, these two pieces of content is not j2se inside the content, but in the day-to-day development, and other programs, and configuration file interaction, more and more inseparable from the two formats of the analysis.

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

XML: Need to understand the fundamentals of Dom parsing and sax parsing and their respective scenarios

JSON: Need to know some common JSON framework usage, such as Jackson, Fastjson, Gson, etc...

Use of 17.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 updating of development processes and the release of releases, and even the release of updates, using MAVEN can greatly simplify the complexity of the development process and thus save a lot of time. It can be said that Maven has become the standard for Java developers. So I put Maven as a prerequisite for Java developers as a knowledge point. I'll put some of my experiences and tips on Maven in the future.

18. Generic type

This is the new concept that JDK5 began to introduce, which is actually a grammatical sugar, when writing Java code will be a little convenient, the general application or business development, simply to use, does not necessarily use the definition of generics such operations, but the development of some basic common components will be used, you can look at this section when needed , in general, as long as the simple use can be.

19. Callout

was introduced after Jdk5. Spring is a good framework, starting with XML as a standard configuration file. However, after the Spring3, especially after the rise of spring-boot, the increasing use of annotations to simplify the XML configuration file, for developers, can save a lot of XML configuration time. But the disadvantage is that tagging is scattered across classes, unlike XML, which has a holistic understanding and management of all configurations, so there's no way to say that it completely replaces all XML. For the general developer, the annotation can be used, some public-built developers may need to understand the definition and implementation of annotations, can be more detailed when the need to look at.

20.RMI

Remotemethodinvocation, the Java language-specific remote invocation interface, is still relatively simple and convenient to use. However, in the case of cross-language, it is necessary to use other means such as webservice to support. Generally speaking, the program does not need to use RMI, but can be used in a specific case, I am in a project, using RMI for the program to start remote control stop.

21.JNI

Java Native Interface, which allows local interface methods to be invoked in Java, and is typically used for calls to C + + code. Note that the path to loading the So/dll file in Java is not complicated by its calling interface, but it often takes more time to load the required local interface library.

The above is just a brief introduction to the Java Basics and technical points I have some of the views and introductions, which are derived from my years of using Java some of the summary, I want to just touch Java, or intend to develop from Java some experience, Hope to be able to learn and use Java more efficiently, avoid a detour wasted precious time. Some of these are not perfect, and will be added through the articles in the future. Because of the limited personal ability, of course, there will be some mistakes and omissions, welcome correction, together to discuss, together to improve the article, I hope it can really help people in need.

Above this Java knowledge Point summary-to the Java novice Some suggestions (novice must SEE) is small series to share to everybody's content, hoped can give everybody a reference, also hoped that everybody supports the cloud habitat community.

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.