Home >Java >javaTutorial >Do you know the basic Java knowledge required for interviews?

Do you know the basic Java knowledge required for interviews?

php是最好的语言
php是最好的语言Original
2018-07-26 15:12:071778browse

Java knowledge cannot be mastered overnight. Some newcomers who have just learned it have no pragmatic spirit and are self-righteous. They feel that they have learned the basics and are so ambitious. They always want to learn advanced knowledge as soon as possible. I am not here. To belittle beginners, as the saying goes, tall buildings rise from the ground, only after laying a solid foundation. Let’s take a look at the embarrassment of the rookie below.


This involves the exception stack, compile time, main function and so on, which are very basic. Knowledge, there are some newcomers who are rude and say, why don't you make it easy to understand?

Easy to understand, it costs money.

Exception is an abnormal situation that the program does not expect. It cannot handle it and leaves it to the programmer to handle it. Stack is an extremely basic data structure. Its appearance indicates that the element at the top of the stack is the last one pushed onto the stack. So, have you seen the pile of text thrown by the console after you made an error? Post it, the one closest to XXXException is usually the most critical information.

You see, even if it is reduced to "the pile of text thrown by the console", in comparison, the "exception stack" saves more time for both parties. After all, with the current salary level in the IT industry, a veteran may The company has wasted dozens of dollars.

What's more, some people may not even understand the "console", which involves function 2.

There are novices who are even less pragmatic and exaggerated.

I have seen a resume and wrote a bunch of quartz, POI, easyUI, jquery, etc. This person may think that these terms are high-end and powerful, but look at this skill list:

reveals his problem, this person is not Understand what these terms he is talking about are.

At least, a basic programmer will not write that he is familiar with xml, json, dom4j technology, nor will he put "online payment" and servletjsp under the same column. There is no need for him to describe at length how full his skill tree is. Appropriate content and reasonable layout itself represent his level.

It doesn't matter if the newbies don't have a solid foundation. They can learn slowly, but they must have a learning attitude and method, have the ability to solve problems, use their own subjective initiative, and don't do anything to solve the problem. , let others chew things up and feed them to you. In this case, it will be difficult for oneself to grow up.

For example:

Generally speaking, the old birds who have suffered these three consecutive attacks are all angry from the heart. As long as there are exceptions, they either have a too good temper. Either the girl is too pretty.

Suitable solution: Search for keywords->View documentation->Read source code->Ask veteran keywords->*.

How to solve the problem that has never been solved before? Or expand on it, how can the function I wrote adapt to the various needs in the future? Of course, this is essentially a question of code volume and reading volume.

Come down and give newcomers some learning methods and ideas.

I divide learning into several stages:

(1) Basic understanding stage, you see a basic knowledge point, start to understand its meaning, see Specific examples can reflect the basic knowledge they correspond to. For example, seeing Animal cat=new Cat() can reflect that it embodies the following knowledge points: declaration, instantiation, reference, and polymorphism.

(2) Concatenation stage, connect the knowledge points together to construct its original appearance, such as the above example, combined with JVM related knowledge, a rough stack diagram appears in the mind , just like this picture:

This ability can not only be used to speculate on the origin, but can also actively combine knowledge points to create new structures, such as, The new requirement is "Spawn animals based on configuration".

Then, we analyze that there will be a build tool that generates animal instances based on configuration items. The code may look like the following:

Animal animal=AnimalFactory.createAnimal("cat");

In createAnimal, we perform an if judgment on the string to determine whether it is new Cat or new Dog

In fact, someone has already summarized this structure in GoF. Hey, what is GoF? Have you forgotten what this paragraph is about?

(3) Advanced stage, after having the ability to connect knowledge points, you should have the ability to see the specific implementation of unknown technologies. For example, hibernate, what is its function? The core lies in "realizing the synchronization of the persistence layer and the data layer", that is, the mapping of the data table and JavaBeanPOJO. So, let's think about it, if there has never been an ORM framework similar to hibernate, how to implement this function?

First of all, we need to have tools and configurations to communicate with the database. Java can use jdbc, and database-related configuration can use any method such as xml, json, or bean. We can also see that the bottom layer of hibernate is jdbc, and there is also a configuration entry called Configuration.

Then there must be a configuration method to unify the data table and the Bean. Why? Because the amount of information they contain is inconsistent and the information they contain is intersecting. For example, they all have similar data types (varchar->String) and have incompatible contents (indexes and constraints). We draw the conclusion, We need a mapping tool to match the intersections and fill in the missing content. Therefore, we can deduce that hibernate must have a mapping tool (xml and annotation).

Later, in order to adapt to a variety of different databases, each statement may have a different expression. For example, Oracle has the Number(*,*) type, which is not applicable to mysql. We need to design a database. adapter. In hibernate, this part is called dialect.

After such an analysis process, whether it is to implement new requirements or analyze unknown frameworks, we will have a theoretical foundation.

In my personal opinion, only programmers who have reached this stage can be called qualified. Having said so much, you need to introspect yourself to know where your problems lie, and then find and solve them.

Related articles:

Small summary of java basic knowledge

Related videos:

The latest Java complete Video tutorial

The above is the detailed content of Do you know the basic Java knowledge required for interviews?. For more information, please follow other related articles on the PHP Chinese website!

Statement:
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn