Home  >  Article  >  Java  >  Get started quickly with Java, start with these six skills

Get started quickly with Java, start with these six skills

巴扎黑
巴扎黑Original
2017-06-26 11:14:571141browse

1. Master static methods and attributes
Static methods and attributes are used to describe the characteristics of a certain type of object group, rather than the characteristics of a single object. Static methods and properties are heavily used in Java, and this is a common trick. But this technique is not used frequently in many languages. Understanding static methods and properties is very helpful for understanding the relationship between classes and objects. In a large number of Java specifications, static methods and properties are frequently used. Therefore learners should understand static methods and properties. Java is consistent in calling methods and properties. The difference is only reflected in the declaration, which is different from C++.


2. Pay attention to interfaces
Class inheritance was widely used in early object-oriented applications. With the continuous development of software engineering theory, people began to realize the many shortcomings of inheritance and began to work hard to replace inheritance with aggregation. The important principle for software engineering to solve scalability is abstract description, and the tool used directly is the interface. Interfaces have gradually become the core of Java programming methods in recent years. On the other hand, as far as applications are concerned, most development is based on specifications, and there is no need to build complex inheritance relationships and huge classes yourself. Therefore, understanding the specifications and using them well have become the primary task of application developers. The main description method of Java specifications is the interface.


3. Learn the collection framework well
The main way to describe complex data structures in Java is the collection framework. Java does not have pointers, but uses a powerful collection framework to describe complex data structures such as arrays and object arrays. Learning the description methods of these data structures is crucial for application writing, especially when it comes to server-side and 3-layer structure programming. Programmers at this time can no longer use structures such as database result sets to describe data.
Because many languages ​​do not have such a powerful collection framework system, many beginners are at a loss, let alone what to use it for, so it should be paid enough attention to.


4. Exception Capture
Java’s emphasis on exception capture is unprecedented. It forces programmers to describe exception capture in a significantly different way from the logical method. , which is of great significance to the completeness and rigor of program description. C++ also has similar mechanisms, but we see that many C++ programmers are not accustomed to using these mechanisms.
Java beginners should fully learn this exception catching mechanism and develop good programming habits.


5. Multi-threading requires understanding of the mechanism
Many Java programmers are keen on writing multi-threaded programs and consider it a challenge to their logical abilities. In fact, in a large number of applications, there is no need to write multi-threaded programs at all, or most programmers who write application programs do not write multi-threaded programs. This is because multi-threading mechanisms are built into the base platform.
What programmers should understand is the principle of multi-threading and multi-thread safety, which is crucial for accurately grasping programs in the future.
For example, JSP written to different locations has completely different security implications for multiple user environments. Another example is the famous Super Servlet, where each access is a process, but each page is a thread, which is exactly the opposite of Servlet. The impact on program performance and security can be vastly different.


6. Understand network programming
Java is known as the most powerful network programming language, but most application developers never develop any underlying network themselves. procedural.
All you need to do is understand the principles. The implementation of the network mechanism relies on the platform. Unless you develop the platform yourself, you do not need to know how to implement the socket and how to monitor access. Therefore, spending too much effort in this area will deviate from the assumption that "future application development will be carried out on mature platforms, rather than developing the platform from the bottom itself."


Learn JAVA quickly, start with the above six programming skills.

The above is the detailed content of Get started quickly with Java, start with these six skills. 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