Seventh: " exceptions, assertions and logs " Summary of Knowledge pointsthis week, we learned about exception handling in Java, and here are some of the gains. I. The difference between an unchecked exception and a checked exception:unchecked Exception handling method: 1, capture 2, continue to throw 3, do not handle. checked Exception handling methods: 1, continue to throw, negative methods, can always be thrown into the
Help message-X Print Help on non-standard options-ea[:-enableassertions[:Enable assertions with specified granularity-da[:-disableassertions[:Disable assertions with specified granularity-esa | -enablesystemassertionsEnable System assertions-DSA | -disablesystemassertionsDisable System assertions-agentlib:Load native Agent library See Also,-agentlib:jdwp=help and-agentlib:hprof=help-agentpath:Load native Agent library by full pathname-javaagent:Load Java
Java environment variablesProgramImpact
Java_home =/opt/Java/jdk1.6.0 _ 13Classpath =.: $ java_home/lib: $ java_home/JRE/libPath =.: $ path: $ java_home/bin: $ java_home/JRE/bin
The environment variable classpath is closely related to Java program development,When you use javac to compile a
to think too much about getting a pixel of an image, but if you want to set a pixel, and the data type or bit width of the pixel is less than the width you want to set, you have to be aware of it, but it's safer to use the double setting and automatically convert it internally. You will see in the Java version of the OpenCV method in many places are using a double, this is really a lot of waste of memory, many times we are dealing with 8-bit unsigned
Java mail sending program (can be sent to multiple addresses at the same time, can carry attachments), java mailMain Program for sending emailsImport java. util. Properties;Import common. util. Email_Autherticatorbean;Import javax. mail. Authenticator;Import javax. mail. int
Java-based online shopping cart program and java-based online shopping cart
Use java code to write a simple online shopping cart program for your reference. The specific content is as follows:
Requirements:
1. Write a product category, which includes the product ID, product
To write Java programs, the Java SDK is essential, Mac OS System comes with the SDK, if you feel that the version is too low, you can go to the official website to download the latest.Open the terminal and create a new Helloworld.java file:Vim Helloworld.javaStart writing programs, (for everyone to learn better, please refer to the figure of the code, to discard the pleasure of copying and pasting)Next save
Original: Share a very useful Java program (key Code) (eight)---Java InputStream read the network response response data Method! ImportantJava InputStream Read Data problems======================================================================principle Explanation1. About Inputstream.read ()When reading data from a data stream, it is easy to use the Inputstream.r
By using some auxiliary tools to find bottlenecks in your program, you can optimize the code for the Bottleneck section. There are generally two scenarios: optimizing the code or changing the design method. We typically choose the latter because not calling the following code can improve program performance better than calling some optimized code. A well-designed progra
If the Java program consumes more resources and is unstable, it can use its own VISUALVM tool for monitoring and performance analysis, and can also generate snapshots for further analysis based on the application snapshot functionality it provides. The procedure is as follows:1. Execute the "JVISUALVM" command under the CMD console or Linux terminal of Windows to enter the
Although there are many programming software to implement Java programs, very few people will use Notepad to write, but this for beginners, this is a good way to understand how Java operation. and others do not understand, you know is not very handsome. (personal view)------------First, create a new Java file1. New Notepad (. txt) à rename to Helloworld.java (tak
Setting variablesThe program installation directory isC:\Program Files\java\jdk1.7.0_67\bin Advanced system settings, environment variable settings in; Add this location after the numberDirectly verifies that the environment variable is configured successfully in CMD via Java commandWrite a programClass vardemo//define
1. Computer programs: a collection of ordered instructions written to allow a computer to perform certain operations or solve a problem. 2. JAVA Related technologies:1), Install and run desktop programs on this computer2), Internet-facing applications accessed through a browser3), JAVA you can also make very good image effects.3. steps to develop a Java
Reload Eclispe, reconfigure Tomcat, and configure Tomcat in Eclispe. Configuration all smooth, configuration completed inspection.
Create a new Java Web program, and then test it.
In Eclispe, create a new Java Web program with the following results:
Please pay attention to the red dots on the
Compile and run java program in ubuntu -- configure java environment variablesConfigure java environment variables in ubuntu (detailed)1. decompress and install jdkGo to the jdk-6u14-linux-i586.bin file directory under the shell terminal,Execute the command./jdk-6u14-linux-i586.bin at this time there will be a protocol
[JAVA concurrent programming practice] 10. concurrent program testing and java practice1. Generate a random number
Package cn. study. concurrency. ch12; public class Util {public static int xorShift (int y) {// shift left and unsigned right, and last XOR operation (XOR, if the two bits are different, the value is 1; otherwise, the value is 0) y ^ = (y
2. cache
Use java to understand program logic, variables, and java to understand logical variables
Data Type
Description
Example
Int
Integer
Used to store integers. For example. Number of trainees. Employee ID of a company. The number of days in a year. Hours per day
Double
Dual-precision floating point
Stores decimal numbers.
I used GCJ to compile itext and used itext to write many small programs (pdfrotate and nup_pdf can be obtained from the Internet now). Here I will only introduce how to obtain the GCJ compiling environment.
GCJ is a Java editor based on the GNU protocol. It supports the following compilation methods:Java Source Code directly compiles the local machine code. On windows, the exe executable program (separated
Java program performance optimization and java Performance Optimization
Java program tuning entry-level tutorials seem very thick. In fact, the book is very thin, domestic handwriting is high, of course there are some content suspected of plagiarism, suitable for
described in the previous article, and the same bufferedwrtier and bufferedreader efficiency is also very high. The buffer is used preferentially.
Using static methods: Static methods can be used directly without building an instance, and because the method area GC is rarely recycled, and the JVM caches commonly used classes, some common tool classes are more likely to encapsulate static performance. And it is more expressive than function overloading.
Use design mode: You can replace t
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.