Java program performance optimization skills and java performance optimization skills
1. Optimize the loop bodyIf the number of loops is large, the problems with poor code processing in the loop body will be magnified.
For (int I = 0; I
2. Use new to initialize an instance.The time consumed by a new object is often thousands of times the time consumed by the as
Four weeks of study experienceThrough this week's study, the main content of the study is the fourth chapter involves the knowledge point, the teacher explained in detail about the integer separation of the program and about the circumference and area of the rectangle and circle procedures, the understanding of this parameter and static variable is not deep enough, still not use it, my program will not writ
Through the third week of study, I learned about the object and class in the Java language this piece of knowledge point.Java is an object-oriented programming language, object-oriented programs are composed of objects, classes (Class) is a template or blueprint for constructing objects, so learning objects and classes is very important.With regard to the use of objects and classes, if you want to use an object, you must first construct the object, sp
Java Fifth Week learning experience through this week's study, the inheritance has a certain understanding, but not very familiar with the teacher in class according to the previous method of the fifth section of the understanding of the deeper into a bit, but also need a lot of code to grasp the deeper, because the method of sudden change, or there is a little unaccustomed, so now still in the adaptation, Feel that some knowledge is not very deep,
java Tenth Week learning experience Through the tenth week of learning, we learned about generic programming (Generic programming), which is also known as a parameterized type, that is, when defining classes, interfaces, and methods, the type parameter indicates the type of object that will be processed (such as the ArrayList Class). Generic programming means that writing code can be reused by many different types of objects, generics are abstract s
JAVA program, basic data type, data type conversion, variables and constants, common operators, java Operators
I. Basic Data Types
Integer type: byte, short, int (commonly used), long (usually used)
Defines a variable int a = 10;
Floating point type (decimal): float, double (commonly used)
Character Type: char (not a string)
Char B = 'A'
Escape Character class:
Java BASIC program process control (below), java ProcessJava program flow control (below)
This article separately sorts out the knowledge points of the loop structure:
The loop structure is divided into: for Loop, while loop, do... the while loop has three basic loop structures. In Versions later than JDK1.5, The forea
);//(2) begin = System.nanotime (); StringBuffer s2 = new StringBuffer ("Hello"); S2.append ("World"); end = System.nanotime (); System.out.println (End-begin);}Second, Currenttimemillis ()Returns the current time in milliseconds. Note that when the time unit of the return value is milliseconds, the granularity of the value depends on the underlying operating system, and the granularity may be greater. For example, many operating systems measure time in dozens of milliseconds.Return:
the
Development tool: Eclipse-jee-juno-sr2-win32-x86_64 (please download it by yourself)
Using the server: apache-tomcat-7.0.35-windows-x64 (please download it on your own website)
Open Eclipse:Press to install JDK1.7 before openingBecause eclipse needs the JDKSteps to read
2Find ' window ' under ' Preferences 'Click ' Preferences 'Steps to read
3Find ' Preferences 'Server---rntime evironmentSteps to read
4Click ' Add ' to add a new runtime environment:Steps to read
5Select
Java exercises, how much you can do. http://bbs.csdn.net/topics/110067294
This is seen from CSDN. One every day.
"Program 11"
Question: There are 1, 2, 3, 4 digits, which can be composed of a number of different and no duplicate number of three digits. is how much.
1. Procedure analysis: Can fill in the hundred, 10 digits, single-digit digits are 1, 2, 3, 4. Make up all the permutations and then remove the
Question requirements:
Design a program in Java to implement the symmetric number of a string, such as the string "effeghg", which contains three symmetric characters: "FF", "effe", and "GHG, so 3 is returned.
My idea is to traverse this string,
First, select the first character as the header and traverse the string from the end,
If the start and end of the string are the same, the intermediate string is u
Important points of knowledgeFront-End Basics: HTML, CSS, JavaScriptJava Web Foundation: JSP, Servlet, JSTL, El expression, filter, listener, MVCJava Development tools: Eclipse, IntelliJ ideaProject CombatCampus Network homepage, Carousel Chart effectLogin, registration, paging, verification code, single sign-on, import and export, shopping cart managementBackground management projects for books and courses: Baidu Network DiskJava Siege Lion training program
印。后置打印返回结果(返回的结果是一个复杂的类)。(2)学习内容:spring框架试验方法:对某一包下,所有类的方法做切面,打印日志。4. 反射机制学习内容:java的反射机制试验方法:写一段程序,调用一个Bean下实现了标注(“autocall”)的方法5. 配置数据源学习内容:配置数据源实验方法:自己建一张表,引入数据库连接池,自动插入20万条数据,创建联合索引,验证走索引和不走索引的耗时,查看sql是否走索引,学会查看查询,计划实验,用标注式事务,编程式事务(查看编程式事务源码实现);用乐观锁和悲观锁实现数据更新。
Learning needs to know:1. What is2. What problems have been solved3, how to achieveThis article goes to CSDN, the "Java Basic learn
moving, thinking that the program where the problem stuck dead. There is a progress bar in the lower right corner of Netbeans, which runs 4 times in a row when the program has output, then turns blue and stops running. (In this case, do not think the program is wrong ~ ~ ~)A small trick is that if the function is a recursive call, you can add a static variable t
There are several changes in go, which are an old problem. The superficial saying is that 3 is 19 to the power of 19, which means that every vertex on the board is in three states: free, black, and white, there are 19*19 points in total, so this result is obtained. But in fact there are not so many, because in so many States, a large part of the status is not possible, that is, there is a dead play on the disk. For example, it is impossible for the whole board to be filled with pawns, and this s
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.