Some key points in the Java learning process

zhaozj2021-02-16  47

I started learning Java from a year and a half, when I started learning Java, I started to go to the Java version, from the beginning, see the problem, slowly to answer the problem of others, one year Learning really feelings

Some people think of individuals in the Java learning process have been summarized, and they will be shared, and I hope to help the later people go less, focus on the fingers, and quickly walk into the gate of Java.

I started to learn from Java 2nd, I still like this book, although I haven't read it until now, I have different ways of learning, and some people like to see Core Java. Or Java How to Program, these are good books, choose a suitable look at you, ^ _ ^ Mainly talk about the few big pieces of Java, can't be said to be very fine, because in fact, every piece can be said a lot , I will say that the focus of these students or things should be noted.

Value type: Although it is an object-oriented language, the value type is still essential, if you have mastered C calculations and conversion rules in C, then I don't think there is no problem, only two Points Need Note: 1,14.0 This floating point constant is considered to be a Double type, only plus the F suffix is ​​a Float type; Will it see the minimum value that can represent the number, so byte b = 100; will not report an error

Quote: I also turn over from C / C , in fact, the so-called reference type is reflected in C , there is a reference type when passing, from C, it is a pointer, but we can't It makes hard exercises on the pointer. So the focus here is: 1. All objects in Java are generated in the heap, so things that need to be similar to pointers point to it, that is, references; 2, we will use the reference to the object to reference, in addition to assignment In addition, there should be no operation is for the reference itself, this is the difference between C's pointer and Java's reference.

Class and object: This is a large piece, there are many things, not to speak, say a few points: 1, class method, class attribute and member method, member attributes are loaded, initialized, and the same; 2, In the constructor, this () and super () usage; 3, subclass load process, initialization process, and constructive process; 4, overloading and overwriting; 5, overwriting the polymorphic problem ( Note: The application of polymorphism is in the method, there is no effect on attributes)

Parameter Passage of Function Call: If the address value recorded by the reference type is as a reference to the value of the reference type variable, then when all method of Java is called, the value passed - numerical type transmitted value, Quote Type Biographical address.

IO stream: Compared with C, Java input and output, especially input is very troublesome, maybe because of the object-oriented consideration? do not know. Java offers a lot of IO streams, but we don't have to figure out all kinds of IOs. We only need to know what features each with the characteristics and characteristics, how the character stream is constructed on byte stream, almost all When the character stream is constructed, it is based on an existing byte stream, and its design makes we can set up the IO to one-section one section like a set of pipes until we want to Use the IO object (Example: BUFFEREDReader). When we use it later, we can check the API again. I think the few classes that mainly want to see are: FileReader, FileWriter, BufferedReader, with the System.out object, for the input of the text, it is enough Used, as for others, I don't think it is necessary to see so much. I used it again (I used Java for a year and a half, basically using bufferedreader and system.out) container: Personally, This is a big tool for Java programming. The class of my favorite is: arraylist (list) as a variable length array, hashmap (map) is used to create a lookup table, and I rarely use it, only in the use of HashMap I have used some. By familiarity with these two classes, the basic usage of List, SET and MAP can be grasped. In addition, it has several auxiliary classes to master: Iterator and Collectes. The Collectes class provides some universal tools for containers, such as sorting. In terms of sorting, it involves the comparator: Comparator. Can skilled using the Comprator class, let you sort your needs and your own customs.

AWT and SWING: Personally, Java has very good encapsulation in the production of the graphics interface. I used to try to learn MFC, MFC will help you generate some code when generating a graphical interface, then let you have some code. The specified location is added to implement the function. I have a habit of this person. If I let me see something, then I don't know why you write, you won't go down, see that many of the code, naturally want to figure out Those who are, the result is a lot of knowledge, and then I only know that some of them are calling WinApi, and I will still use MFC now. Here is not to degrade MFC, I believe that MFC has a matter of people, but personal thinks that its package is not doing well, exposes too much things, maybe it can improve flexibility, but maybe I will have no deeper with it: (. Java in this regard, give you a class, you are using it, it hides the low layer of the graphics interface, give you it as an object, and you only need to repair this object Modifying, very convenient ^ _ ^ As a beginner, I think the focus of AWT is its number of listener's usage, and the layout format, then that many of the company's use and usage (however, I think, wait until you use When you go to find a suitable Component to learn, you should not be too late. ^ ^) However, because of my personal use, the AWT and SWING have been used very little, so this is inconvenient to say, Sorry ^ _ ^

Write these is not to tell you how to solve the problem, because there is a lot of writings, just hope to give beginners, hoping to help beginners are targeted. Write so many things for the first time, welcome everyone to discuss, correct. Thank you ^ _ ^

转载请注明原文地址:https://www.9cbs.com/read-25367.html

New Post(0)