I tried again on my computer after I went home from yesterday's problem.CodeRemember it as long as it is not long. It seems that the same occurs after compilation and running.
The problem occurs, so we set the classpath path and run it again. It seems that this is the reason. The first thing I did this morning was to set the classpath environment variable. The strange thing is that the problem persists. Is there a problem with the environment variable? Next, I found a demo of the applet in JDK to try it. There is no problem. The operation is successful and it seems to be mine.ProgramThere is a problem with writing. Fortunately, there were not many errors, so I checked them one by one word and finally found the error:
////////////////////////////////////
<APPLET code = "Hello. Class" width = 250, Height = 90>
</APPLET>
////////////////////////////////////
Do you see the error? Alas, the old bird will laugh at me silly. Add a comma after 250. :(
In the second chapter of Java programming ideology (the third edition), we talked about "Everything is an object ". Objects Created with new in Java are stored in the heap, and the original (primitive) data type is put into the stack in terms of efficiency.
The following code describes the scope:
//////////////////////////////////////// ///
{
Int x = 125;
{
Int x = 34; // illegal
}
}
//////////////////////////////////////// ////
In C/C ++, there is no problem in writing this Code. This is called scope blocking (is it so called ?), But such writing in Java is illegal. It is indeed a good practice to avoid ambiguity.
Then I learned some terms, including gabage collector (Garbage Collector), classes, data members, methods, default values, parameters, return values,
The parameter list, many of which are the same or similar to those of C ++, is not difficult to learn.
The next step is the namespace. To solve this problem, the Java designer uses the inverted domain name as the name of the class library, because the domain names are unique, so that the problem of duplicate names can be avoided. (A little bit, but you still need to practice it before you can really understand it .)
The next two terms are "import" and "static". I was very impressed by the previous mistake, and the last one is very simple. Then the author uses a program to teach us how to use Java document. This is really a good thing. to do good deeds, we must first sharpen the tool. These Java tools look like it is a kind of amazing.
I also found the CHM version of a JDK document.
"Java has some good ideas. One of them is that writing code is not the only thing that matters-writing code.CompositionIt must at least be of the same importance as him ." (I deeply agree with this sentence, because I am enjoying the destruction of a program without documentation ~)
Javadoc is widely used. Of course, the documentation is also very beautiful. However, it is not the focus of my study now. Remember it first.
Then the author talked a little bit about the programming style, except that the use of curly braces makes me uncomfortable. -_-B
Next we will go to the third chapter of Java programming ideology (Third edition). Now we have time to continue.
Java operators and otherProgramming LanguageThe usage is basically the same, and the priority is extremely high. However, many people cannot remember the priority. It doesn't matter. Just use brackets.
The value of a Java object must be mentioned. It is attached with reference (the author who translated the third edition of Java thinking does not translate this word. Is there still controversy about the translation of this word? Since C ++ calls it a reference, we call it a reference. Is it the reference function?), including
Java value transfer is also a reference, not a value.
The regular expression (regular expressions) once encountered a headache in the operating system class. I encountered it a few days ago when I watched C #. I did not expect it.
Today, I saw it again. It's really unavoidable. Here it is a way to describe strings in general terms.
The plus and minus signs of a unit, auto-increment and auto-subtraction, and Relational operators.
I sold cakes. Here we are.
See you next time.