In addition to Weibo, there is also WeChat
Please pay attention
WeChat public account
Shulou
2025-03-31 Update From: SLTechnology News&Howtos shulou NAV: SLTechnology News&Howtos > Development >
Share
Shulou(Shulou.com)06/02 Report--
What this article shares with you is about the key points of the Java learning process. The editor thinks it is very practical, so I share it with you. I hope you can get something after reading this article.
The focus of the Java learning process is mainly about several large pieces of Java, but it is impossible to talk about it in detail, because in fact, each piece can say a lot. I will just talk about the key points or things that should be paid attention to when learning.
Numeric type:
Although it is an object-oriented language, it is necessary to use numerical types. If you have mastered the rules of numerical calculation and conversion of C in the study of C, then I think there should be no problem here. There are only two points to note: floating-point constants such as 1 and 14.0 are considered to be float, and only the f suffix is float. 2. Integer constants are considered int, but at compile time, the compiler can think of it as the minimum value that can represent that number, so byte b = 100; will not report an error.
Reference type:
In fact, the so-called reference type is already reflected in C++, that is, there is a reference type when passing parameters. From C point of view, it is a pointer, but we cannot perform hard operations on it on the pointer. So the point here is: 1, all the objects in Java are generated in the heap, so we need something like a pointer to point to it, that is, a reference; 2, what we operate by reference is the object pointed to by the reference, in addition to the assignment operation, there should be no operation for the reference itself, which is the difference between C pointer and Java reference.
Classes and objects:
This is a large block, there are a lot of things, do not expand to talk about a few key points: 1, class methods, class properties and member methods, member properties in loading, initialization, and use of similarities and differences; 2, in the constructor, this () and super () usage; 3, subclass loading process, initialization process and construction process; 4, method overloading and overwriting; 5, overwrite caused by polymorphism. (note: the application of polymorphism in methods has no effect on attributes.)
Parameter passing for function calls:
If the address value recorded by the reference type is regarded as the value of the reference type variable, then all methods of Java are passed with the value. The numeric type passes the value and the reference type passes the address.
IO stream:
Compared with C, the input and output of Java, especially the input, is very troublesome, perhaps because of object-oriented considerations. I have no idea. Java provides a lot of IO streams, but we don't have to figure out all kinds of IO. We just need to understand the functions of byte streams and character streams, and how character streams are constructed on top of byte streams. Almost all character streams are constructed on the basis of an existing byte stream, and its design allows us to set IO streams together like a sleeve. Until we get the IO object we want to use (for example, the use of BufferedReader). In our future use, we can check API, I think the main to see several classes are: FileReader, FileWriter, BufferedReader, coupled with System.out object, for the text input, output, it is enough, as for the other, I do not think the test, there is no need to see so much, when you use it. (I've been using Java for a year and a half, basically using BufferedReader and System.out.)
Container:
Personally, this is a sharp tool for Java programming, my favorite class is: ArrayList (List) as a variable length array, HashMap (Map) is used to build lookup tables, Set I rarely use, only in the use of HashMap in conjunction with some. Through familiarity with these two classes, we can master the basic usage of List, Set and Map. In addition, several helper classes should be mastered: Iterator and Collections. The Collections class provides some common tools for containers, such as sorting. When it comes to sorting, there is a comparator: Comparator. Proficiency in using Comparator classes allows you to customize sorting schemes for your own needs and your own classes.
AWT and SWING:
Personally, I think that Java has a very good encapsulation in the production of the graphical interface. I have tried to learn before that MFC,MFC will help you generate some code when generating the graphical interface, and then let you add code to the specified location of the code to achieve the function. I have a habit that if I see something, then I will not go down if I don't clear why it is written in this way. When I saw all that code, I naturally wanted to figure out what it was, which led to a lot of knowledge. Later, I learned that some of it was calling WinAPI, and I still don't know how to use MFC. This is not to belittle MFC, I believe that MFC has its advantages, but personally think that its encapsulation is not good, exposed too many things, may be able to improve flexibility, but maybe I have nothing to do with it. Java has done a good job in this respect, giving you a class, you can use it, it hides the low-level implementation of the graphical interface very well, and gives it to you as an object, and you only need to modify this object, which is very convenient.
These are the key points of the Java learning process, and the editor believes that there are some knowledge points that we may see or use in our daily work. I hope you can learn more from this article. For more details, please follow the industry information channel.
Welcome to subscribe "Shulou Technology Information " to get latest news, interesting things and hot topics in the IT industry, and controls the hottest and latest Internet news, technology news and IT industry trends.
Views: 0
*The comments in the above article only represent the author's personal views and do not represent the views and positions of this website. If you have more insights, please feel free to contribute and share.
Continue with the installation of the previous hadoop.First, install zookooper1. Decompress zookoope
"Every 5-10 years, there's a rare product, a really special, very unusual product that's the most un
© 2024 shulou.com SLNews company. All rights reserved.