In this week to personally feel the teacher's reversal classroom test, although the heart is fear and rejection, but in the test after the examination questions with the teacher's explanation, the feeling is still effective, mastered some basic concepts and simple procedures of the ideological structure. So, for this week's Java learning, the following summary is made:
data type of 1>java :
2> operator
3> string
In the Java language, string data is actually implemented by the string class. There are two classes of Java string classes: One is the immutable string that is not changed in the program, and the second class is a variable string that will be changed in length in the program. The Java environment provides string and StringBuffer two classes for storing and maintaining these two types of strings. Create a String example: Stringstr=new ("This is a string"), or stringstr= "This is a string"
Gets the length of the string by calling the length () method.
Cases:
String Str= "Thisis a string";
int Len =str.length ();
4 > Input and Output
System.out is the data standard output stream, which has the print and println methods, the meaning of the Print method is not to wrap the output, println is the line-wrapping output.
5> Control Process
If of a Java conditional statement
In life, we often need to make judgments before deciding whether to do something. For example, if your test score is greater than 90, reward an IPHONE 5S. You can use the if condition statement to implement situations where you need to determine the condition before the condition is met.
The if...else of the Java conditional statement
The operation of the If...else statement is one step more than an if statement: when the condition is true, the code block of the if part is executed, and if the condition is not true, the else part is entered.
6> Array
An array is an object in Java, and an array instance is created using the new operator. ARRAY.LENGTH Specifies the length of the array, for example:
| 1234 |
int[] intArray = newint[10];System.out.println(intArray.length)Output: 10 |
Array.Length represents the capacity of the array, as long as the array is created, and each index is initialized to the default value.
Array index starting at 0, negative index in Java is invalid, will throw arrayindexoutofboundexception, if you try to access the array with an invalid index, this invalid index may be a negative index, or is greater than or equal to the length of the array index.
Learning Experience : Although only a short two weeks of learning. Although the time is very short, but each of the lessons have made me gain some basic knowledge, it not only deepened my understanding of some theoretical knowledge, not only made me in theory to Java has a new understanding, in the practical ability has also been improved. I want to learn in the future to develop the initiative and interest, and really do the learning.
Understand the basic program design structure of Java