I wrote a Java class the day before yesterday. I used a static array, compiled it, and deployed it on the Resin server. Later I modified the array value and re-compiled it for deployment, as a result, the value of the array is still the original
Use images:Now we will rewritePaintframe ()To make the image work. This also brings someThe problem is that the image is often quite large, and it takes a lot of time to draw all the images.It is through a slow connection, which is why drawimage has
Set the timeout time for the socket to call inputstream to read data, in milliseconds. If this time is exceeded, java.net. sockettimeoutexception will be thrown.When the readIf you set timeout when the method is blocked(TimeoutIn milliseconds), the
After j2sdk is installed, You need to configure environment variables.Generally, two variables are configured: java_home and classpath.If j2sdk is installed in the C:/j2sdk directory:Java_home = C:/j2sdkClasspath =.; % java_home %/libIn previous JDK
The methods for reading the context path in Java are summarized as follows:
1. Call in any classUrldecoder. Decode (this. getclass (). getclassloader (). getresource ("/"). getpath (), "UTF-8 ");The full path of the current class is obtained.For
This synchronization must be synchronized.
The synchronization block should be as small as possible
Use wait () in a loop ()
Synchronized(OBJ ){
While(Condition ){
OBJ. Wait ();
}
}
Synchronized (OBJ) {While (condition)
To sum up the object creation process, assume there is a class named dog:
1. Even if the static keyword is not explicitly used, the constructor is actually a static method. Therefore, when a dog-type object is created for the first time (the
1. Read File Content by byte
2. Read File Content by character
3. Read File Content by row
4. Randomly Read File Content
Public class readfromfile {/*** reads files in bytes. It is often used to read binary files, files, sounds, images, and other
WebService has become more and more widely used. The following describes several methods for developing WebService in the Java System, which is equivalent to making a record. 1. axis2 Axis is the next open-source WebService development component in
Note: This article applies to Java beginners. If any reader finds that there is something wrong with the article, please correct it.
On the Forum today, someone raised a question about the absence of reference transfer when calling functions in Java.
IT technology is changing with each passing day, and the emergence of new technologies is dazzling. It seems that every day there are new terms. However, the value it needs to achieve is nothing more than data collection, which is then presented to
Original article address:Http://blog.csdn.net/huang_xw/article/details/7318554
/*** @ Description: two threads (thread 1 and thread 2) access the internal synchronization method syn1 () and synchronization method syn2 () of the same object. * result:
Basically, there is no Java-only API to access hardware information. Maybe in the future, who knows?
The requirement for MAC addresses comes from UUID and a large part from license management. This is really a boring thing. I hope the software
Before starting this plan, I would like to share with you my vision for the future of Java. Although Sun, the parent company of Java, is suffering from the acquisition of Oracle, however, the latest Java EE 1.6 standard is still full of vitality, at
The stream of consciousness is a psychological word that describes the natural flow of consciousness. In terms of Java syntax, I hope that it will be messy to write where I think, but I think, I will enjoy reading this article again later.
It is
Java memory Composition
1) Heap
In the runtime data area, the memory of all class instances and arrays is allocated here. Created when the Java Virtual Machine is started. The object heap memory is recycled by the automatic memory management system
The prefix of the bytecode enable.
Type code exampleDescriptionByte BBaload loads byte type from ArrayShort sSastore saves the short type to the arrayInt I iload_1Load int type from local variable 1Long LLcmp compares long type valuesChar CI2C
Sun hotspot JVM
Java version "1.6.0 _ 12"
I. VM parameter Methods
1.-verbose: GCIt will print the status of each GC execution. [the space occupied by the objects before GC is performed-> the space occupied by objects that cannot be cleared after
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.
A Free Trial That Lets You Build Big!
Start building with 50+ products and up to 12 months usage for Elastic Compute Service