preface
C: In the last article, we were able to skillfully use Eclipse to develop a beginner Java program and give some simple instructions to the computer. Although it is very simple, but sparrow is small, all the five organs, you usually use the program should have, it also has.
We are supposed to start learning more Java instructions, but We are worried that you have not learned enough.
In our interpretation of the next article before Java syntax | variables and constants, we first to some basic concepts of computer, as well as the application in computer installation, principle to analyze the execution.
A series of reading
-
The Java syntax | Eclipse person”
-
The Java syntax | programs that something”
-
The Java syntax | variables and constants,
-
The Java syntax | common operators”
Computer three major pieces
The computer we use today is made up of a lot of hardware. However, to install and run a program, we mainly focus on three core hardware, which are:
CPU | RAM | ROM |
---|---|---|
CPU, in chargeProcess the data/To calculateIs a large scale integrated circuit. | Memory,temporaryStore data (after power failure, data will disappear), fast, small space. (High unit price) | A hard disk,permanentData storage, slow speed, large space. (Low unit price) |
Case study: QQ program
Combined with THE QQ program, we have a program from the installation to the operation of the principle.
The principle of program installation
For example, in the future, after the development of the program, if it needs to be used by the customer, it is necessary to prepare the corresponding program package, otherwise on the customer’s computer, the lack of the environment required by the program will not be able to run the program, for example: Java program needs at least one JRE.
We usually in order to use THE QQ program, the first thing to do is to download a corresponding installation program, and then through the installation program to guide us or automatically decompress a series of QQ program files and store to the hard disk of the designated location.
Zha teacher said: setup/boot setup, they are computer programs, but they were born to help ordinary users quickly realize the program environment initialization, program file storage and other processes.
Principle of program execution
Once installed, when a program is to run, the operating system first asks the CPU to read the program files stored on hard disk into memory, and then the CPU executes the program files/code in memory to process the data.
Zha teacher said: each program in the process of running in the memory “occupy” a piece of their own space, and the size of this space and the total size of the memory is to determine whether the program can freely “display hands and feet”.
So when we want to run more programs at the same time without getting stuck, it’s usually a priority to buy a computer with more memory.
When you double-click the QQ shortcut on the desktop, the shortcut will link to the corresponding position of the QQ program, and start up.
Then THE CPU will be stored in the hard disk QQ program files loaded into the memory, QQ program will occupy a piece of its own memory area in the memory, and then by the CPU to execute the MEMORY QQ program files/code, so there is the interface below.
Data management in program memory
When we click “remember password” in THE QQ program and log in once, we open the QQ program login interface again, we will see the QQ number and password directly displayed in the input box.
After loading the QQ program file into the memory, the QQ program code restores the account data saved in the hard disk to the memory, and then inserts them into the input box.
That QQ this procedure is how to save the user’s QQ number and QQ password?
- In memoryQQ number 和 QQ passwordEach allocates a space
- Before the QQ program ends, these two Spaces are managed by the QQ program, and any other programs are not allowed to use them
- Before the completion of QQ’s own use, these two Spaces are always only responsible for saving QQ number and QQ password
- In addition, in order to facilitate finding the memory space, an alias is used to mark the location of QQ number and QQ password in the memory
Afterword.
In fact, inside the program, the space allocated in memory for THE QQ number and password is called a variable, and this is the main topic of our next article! Keep up!
Teacher Zha said: For the learning of technology, teacher Zha has always followed the following steps: With a simple demo to let it run first, and then learn it the most commonly used API and configuration can let yourself up, finally, on the basis of proficiency in the spare time reading the source to try to make myself to be able to see clearly its running mechanism, part of the cause of the problem, at the same time, draw lessons from these technology to enhance your own code level.
So in the teacher’s article, the early basic are small white, only interspersed with a very small amount of source research. Of course, such as the small white update, you still like, the late will not regularly dedicated to part of the technology of the source code analysis.