What is the idea of JAVA programming? The answer may be complex, but it can be quite simple. To understand the idea of JAVA programming, we must first understand what is the concept of programming, let us look at what is the programming idea, in a word, with the computer to solve the problem of people's practical thinking mode, that is, programming ideas.
The ultimate goal of our learning programming language is to use computers to solve our practical problems. So how to learn programming how to start, but also a lot of beginners are puzzled by a problem, especially for the non-computer professional people are more so. In the face of the reality of so many programming languages (such as:c,c++,java,c# ... and a wide variety of applications (such as: Windows programming, Linux Programming, database, network programming ...) )。 It's really confusing and confusing. Let's take a look at the idea of programming from the following points.
One: Procedural thinking of programming
Computers can only recognize0and the1, but people can't just use0,1to write the program. For the convenience of the program, it appeared.0,1the first layer of abstract markup, assembly language. The tags inside the assembly are directly related to the hardware. The hardware manufacturer has a clear instruction manual. These assembly marks can be directly identified by the hardware. LikeCPU, ProductionCPUmanufacturers will have a register of signs such as (ax,bx,cx), Operation instruction Identification(MOV), and so on. Most of the driver programming will use this aspect. The core of the learning assembly is that you need to realize that the assembly is a procedural programming language, and that the currentCPUonly procedural programs can be executed, and any high-level language must be converted into a procedural programming language before being handed toCPUexecution. There are three main operations in the assembly: comparison, Jump (Goto),Procedure Calls (Pager). Why say it is a process of programming ideas, it is worth you to have a good experience. may wish to write a few algorithms of the program (in the program used to compare, jump, process calls), and then to see the characteristics of the assembly program, I believe you will have some sentiment. It is worth mentioning that if you are interested in the operating system, you can also look at what is protected mode.
Second: the structural programming idea
As people solve problems more and more complex, the assembler certainly binds the development of computer software. So the idea of programming has undergone a revolutionary change, and structural programming approaches have emerged. In the programming language of structural programming ideas,Clanguage is the brunt. CThere are several places in the language that can show structural thought: the Branch (if), Loops ( while, for),Structural Body(struct).as long as you use these three, you can write a structured program, but you don't necessarily know what a structured programming method is. What is structured? Why do you sayGotowill undermine the structure of the program? What are the functions of the structure, and can you tell what the benefits of the structure are? These are the places that deserve to be carefully understood. Other people's definitions are not necessarily comprehensive. It is more reliable to understand yourself. Structured programming inside the most representative books will belong to the "data structure", the specific book is better not to know, as if all the same, as long as it is usedCjust write it. CThe "data structure" in language is specifically about how to use structural programming ideas to solve the actual problem of the algorithm. Read some chapters, then find yourself a question, and then use the program to implement it. It can be helpful to write more programs. If you look at the first time after reading a very vague, not to put a first put, after a while to see, you may have a kind of huo cheerful feeling. There is also a need to explain that not all of the time structured programming is set. In some cases, structured programming can make the program more complicated. (for example, structured programming wants a function to have only one entry, one exit.) However, sometimes an exit can make the program look more complicated .
Three: Object-oriented programming thought
Now it's time to talk about object-oriented programming. This is also the most used programming idea now. What is object-oriented and how does it differ from structural thinking? In terms of program syntax, object-oriented is two more features than a structured program:
1 . privatization of members of the structural bodies. within a structured program, members of a struct are public. In object-oriented, however, structural modification is called a class, and members are divided into public and private two parts. Because of this difference, the concept of the interface is created. Is the interface not the public part of a class member? (Think very funny, I just started to know the object-oriented time, think only defined as interface is called interface)
2 . the inheritance of the class. polymorphism occurs because of inheritance. However, it is only because of polymorphism that it appears
such as: Hidden Ah, virtual function ah ... And so on these concepts. The presence of polymorphism allows the same set of data to perform different operations in different stages and in the same way. If this thing is understood, then you will sigh, "the original program can be written so. "
Because of the change of the above two points, the programming thought has undergone a great change. It can make the program more suitable for people's thinking methods to write. There are many object-oriented programming languages.,A variety of :C + +, JAVA, C #.... All sayC + +and theJAVAThere's a big difference, andJAVAand theC #but very similar, do you know why? The most fundamental difference lies in the garbage collector. is becauseJAVAIt has garbage collection function, soJAVACan't andCcompatible, and you cannot use pointers. In theC + +the value types and reference types in are self-defined. If an object is defined as a value type, then when the editor automatically collects the object, it is sometimes unaware of itself. If the object is defined as a reference type, you must also remember to release it, or else it will cause a memory leak. In theJAVAand theC #It 's not the same inside, in both languages, the custom class, the original object can only be a reference type. And there is a garbage collector to help you recycle junk objects. Therefore, there is no memory leak problem. BecauseC #thanJAVAthen come out,JAVAhas the characteristics,C #basically there are. And also has someJAVAfeatures that you do not have (butC# currently not available inLinuxrun above). Of course here is not to say which language is good, which language is bad. In fact, they are all designed to implement object-oriented programming tools. You can also useCor assemble and write a language that supports object-oriented languages (if you want to do it, I absolutely support it, or you can use a compilation.) For China's software business to contribute a force, so as not to always say what language is invented by their foreigners. As long as it can achieve data encapsulation, member privatization, and inheritance on the line. In object-oriented programming, a representative book is a "design pattern". But design pattern this thing, not you can read to understand. And your hard-set patterns don't necessarily have much of a benefit to you. This thing, only design long, to have some understanding, their own summary. Sum up, you will find that the book and those things coincide, perhaps better than the book summed up
well, at present the development of programming thought is to this step. I don't know what future programming ideas will be like. I hope that people with lofty ideals can invent a kind of programming idea, promote the development of software industry, let China also lead the development trend of the world software. If you are a beginner, you can follow the above sequence to learn computer. I hope to grasp the key points in each link. Believe that after a year, you will have some feeling . In between, want to learn Java or want to get More free Java information, can be in the group to understand 521,595,826. Want to have like-minded friends to learn to communicate.
What is the idea of Java programming?