// /**/(iv) Process Control statements1. Branch statementsIf (A>B)AElseBSwith (variable, expression)/* differs from C # in case not break;*/Case value, operation result: statement 1; .... ; default: statement;2. Looping statementswhile (n{Executed statement;}Do{Executed statement;}while{conditions of cessation;}3. Jump statementsContinue:First-loop:Execute the statement;If (condition){Continue first-loop;}Break statement: Only valid if you want to put
Eighth Week Java LearningThis week, the teacher led us to improve the inheritance, excuses, copies, lambda expressions, internal categories lack, imperfect place, help us to check the gaps.as an example of copy learning, I had a very superficial understanding of the copy, the deep copy and the shallow copy is: Deep copy is to create a new object, contrast shallow copy, change the copy of the object properties will not affect the original object. After
Java garbage collection (2) Generational garbage collection of heap memory and java garbage collectionHeap memory generation collection
Java divides the heap garbage collection into three smaller parts: the new generation, the old generation, and the persistent generation. The new generation mainly uses the replication
Java basics 2: break keywords, java Basics
The break in Java is generally used to jump out of a switch or loop.
Do not go into details when jumping out of the switch.
The break Jump Out Loop usually jumps out of the current loop.
If you need to jump out of a multi-tier loop, you can add a label after the break, and
java 12th Week learning experience In the 12th week of the theory class, the teacher of the 1-4 chapters of the content of the test, the program fill in the blanks and write procedural questions are not very high, the important part of the program is missing, for the total number of books that will not be written, deduction points more, but now have mastered, the next to the computer more practice, Friday teacher on the new content of the tenth chapt
learned that it is different from the keyboard to receive input and display results in the console interactive method of interaction, is a graphical user interface. This week, we mainly learned how to create a framework, how to frame it, how to display information in a component, and so on. Then we learned more about how to deal with 2D graphics, how to use colors, how to use special fonts, and so on in our after-school exercises. Then the feeling is that this interaction is really better than
Eighth Week Java Learning experienceThrough this week's study, relative to the previous week, the understanding of the clone, and the understanding of lambda more deeply, but still can not be familiar with the master, only mastered the relatively basic knowledge, for task seven, the task eight or can not complete the writing, can only write part, for the task of seven find out the hometown or have doubts , which has improved a lot more than last week.
Java Nineth Week learning experienceThrough this week's study, learned the exception assertion and the log, has learnt to enable the assertion in the Eclipse compiler, but, regarding the exception, in the shorter teacher teaches the instance the procedure to be able to catch the exception, but in the Long program task Seven task Eight does not know is what kind of exception, No exception catch exception should be added, task nine does not define the L
Java Learning Week 13ththis week, the first six chapters of the knowledge point of the small test, in the test I also found a lot of their own learning on the hidden dangers, some knowledge points to understand too rough, not very good to remember those important small details, the attention to the program run, the algorithm design, but ignored the very important basic knowledge of memory , it is very dangerous, only a good understanding, master the b
Java 11th Week learning experience through the 11th week of study, learned vetor, Stack,Hashtable class, edit run Arraylistdemo and linkedlistdemo two programs and Setdemo, the teacher in class analysis code, and let us experiment, master the better, but the book of the program 365 page 9-2set/settest not very understand, this code through the package import, I do not run out of results, do not know where the error. 201671010117 2016-2017-
In Java, the array is regarded as an object, and length is the attribute of the array rather than the method.
1. One-dimensional arrayDefinition: datatype [] arrayname; orDatatype arrayname []; the first type of Java habits is recommended.The array definition only declares the variables of the array type. In fact, the array does not exist in the memory. To use the array, you need to apply for space for the
Once this information is obtained, you can perform Step 3-use the reflection API to perform such operations, as shown in the following code:
Class C = Class. forname ("Java. Lang. String ");
Method M [] = C. getdeclaredmethods ();
System. Out. println (M [0]. tostring ());
It prints the prototype of the first method defined in string in text format.
In the example below, these three steps will provide examples for Using Reflection to process special
, with the following example:Cars.foreach (Car::collide);3. Method reference for any object of a particular class: its syntax is the Class::method instance as follows:Cars.foreach (Car::repair);4. method Reference for a particular object: its syntax is the Instance::method instance as follows:Final Car police = car.create (car::new ); Cars.foreach (police::follow);Method Reference InstanceEnter the following code in the Java8tester3.java file: Packag
Learning java from scratch (2) classes and objects, learning java objects from scratch
Object-oriented refers to dividing a problem transaction into various objects. The object is created not to complete a step, but to describe the behavior of a thing in the whole process of solving the problem.
A class is the abstraction of an object, and an object is a specific
Java Lesson 2: operators and expressions, java operator expressions
1. modulo %. If the remainder is zero, the Division can be judged.2. The remainder is always less than the divisor.3. When the auto-increment operator ++ or the auto-subtraction operator is used independently, the first ++, -- last ++, and -- operatio
Java BASICS (12) Summary of common classes (2) and java Basics
Here are some of the knowledge points and code I summarized in my previous class. Most of the notes I think are very good and classic, sincerely hope that these will help those who want to learn!
It is inconvenient to upload code by module. There are also many things, and they are also clear! If you n
parent class will output two values without deleting the words. Overrides are variable and method names unchanged, others can be changed. * Encapsulation: wrapping something together and presenting it in a new and complete form;the process of hiding properties, methods, or implementation details is called encapsulation;encapsulation is a matter of selectively exposing or hiding certain information, which solves the problem of data security. * Polymorphism: The rewriting of methods, overloading
Java log Design Practice (2), java log
Several considerations during the design phaseUse Spring Log4jConfigListener to dynamically adjust the Log Level
Add the following content to the corresponding web. xml location:
Note]
1.Do not setLog4jConfigLocationSpecified// WEB-INF/classes/log4j. properties
When log4jConfigLocation is specified as/WEB-INF/classes/l
Java BASICS (15th) Set (2), java basics set
Here are some of the knowledge points and code I summarized in my previous class. Most of the notes I think are very good and classic, sincerely hope that these will help those who want to learn!
It is inconvenient to upload code by module. There are also many things, and they are also clear! If you need it, you can lea
Remove spaces in Java
1. String.Trim ()
Trim () is to remove the trailing space
2.str.replace ("", ""); Remove all spaces, including end to end, middle
String str = "Hell o";
String str2 = Str.replaceall ("", "");
System.out.println (STR2);
3. or ReplaceAll ("+", ""); Remove all spaces
4.str =. ReplaceAll ("\\s*", "");
can replace most whitespace characters, not limited to spaces
\s can match spaces
The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion;
products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the
content of the page makes you feel confusing, please write us an email, we will handle the problem
within 5 days after receiving your email.
If you find any instances of plagiarism from the community, please send an email to:
info-contact@alibabacloud.com
and provide relevant evidence. A staff member will contact you within 5 working days.