() { safethread.setnumber (1)} } private static class ReaderThread1 extends thread{After locking we will see that the output is always 1.Let's summarize the meaning of lock synchronization: The meaning of the lock is not confined to the atomic operation behavior, but also can guarantee the memory visibility. Of course the most important point is that multiple read-write threads must be variable state variables that are guaranteed to be synchronized in the same lock.We now know the main featu
between key and value obtained by the Map.entryset () methodsetTraversing a collection of relationshipsFor (entryGets the key value in the relationshipString S1 = Entry.getkey ();Get value values in a relationshipString s2 = Entry.getvalue ();System.out.println (s1+ "=" +s2);}}The use of generics on the list collection@Testpublic void Testlist () {listList.add ("AAAA");List.add ("bbbb");List.add ("CCCC");Traversing the list collectionNormal for loop, iterator, enhanced for loop (three ways)for
Currently the latest release of POI is 3.10_final. This version of the jar package is protected by:
Maven Artifactid
Prerequisites
JAR
poi
commons-logging, Commons-codec, log4j
poi-version-yyyymmdd.jar
poi-scratchpad
poi
poi-scratchpad-version-yyyymmdd.jar
poi-ooxml
poi, Poi-ooxml-schemas
poi-ooxml-version-yyyymmdd.jar
poi-ooxml-schem
Through the URL package provided by Java, we can download the webpage from the specified website like the IE browser, and the download is definitely the real HTML, with this principle, we can make our own kernel browser!
Please refer to the following source code for implementation principles:
Import java.net. url;Import java.net. urlconnection;Import java. Io. i
New Package : Upper left corner-new-PackageNaming conventions (usually from large to small, easy to integrate and not easy to conflict) For example: Com.itnba.maya.testThe package must be in the top row, and no more code can beUsing packages:Shortcut: Use a variable name in the package alt+/Import package name. class n
path, the relative path and the absolute path are no longer described
JAVAC-CP D:\myeclipse\Workspaces\example\src Example/src/com/example/controller/*.java
question two: How to introduce jar packs
First or in eclipse, it is recommended to create a Lib file, and then put all the jar package here, the project transfer is also more convenient.
Case A
D:\myeclipse\workspaces\example\src>javac Com/example/vi
Geoserver learning note (9): Java package introduction to WMS Engineering Analysis
Su Weimin http://www.gisdev.cn/http://blog.csdn.net/suen/ Date:
All copyrights reserved. If you need to reprint the information, contact the author and indicate the source in a conspicuous position.
The features of geoserver (geoserver learning notes (I): geoserver overview, http://blog.csdn.net/suen/archive/2009/10/25/472620
The following code encapsulates a class that sends messages using a Java Mail package
Import Java.io.File;
Import java.util.ArrayList;
Import Java.util.Date;
Import java.util.List;
Import java.util.Properties;
Import Javax.activation.DataHandler;
Import Javax.activation.FileDataSource;
Import Javax.mail.Message;
Import javax.mail.MessagingException;
Import Javax.mail.Multipart;
Import javax.mail.Ses
Spread a lot of configuration run Java articles, did not find the right, including examples, finally patchwork, for everyone to reference:1. Sublime Text 3--->preference--->Browse Packages, double-click the user folder in the open window. To create a new file Javac.sublime-build, open it with Notepad, paste the following code and save the closing:{ "cmd": ["Javac", "-encoding", "UTF-8", "-D", ".", "$fil
; PrivateString sex; Private intAge/*change to a string type*/ PrivateWife Wife; Public intGetage () {returnAge ; } Public voidSetage (intAge ) { if(Age > 120) {System.out.println ("Error:error Age input ...");//Prompt for error messages}Else { This. Age =Age ; } } /**Setter, getter * for omitting other attributes*/}The above is the setter method of control, in fact, through the use of encapsulation we can also be able to control the export of objects. For exampl
DataOutputStream
These two read and write objects, which can be used to manipulate the stream object of the base data type, contain methods for reading and writing various basic data types.
2. The device is a stream object of memory.
Bytearrayinputstream Bytearrayoutputstream
CharArrayReader Chararraywriter
A, this object does not invoke the underlying resource, so you do not have to close the stream resource, even after it is closed, it can still be cal
I have been installing a Java serial port package for half a day and cannot find the serial port. Now I am done. Make a record ~ Because it is developed under Windows, go to download the http://mdubuc.freeshell.org/Jolt/javacomm20-win32.zip (complete version 2.0, and examples ). Installation instructions: (the so-called installation here is to put three important
Reprinted from http://blog.csdn.net/szwangdf/article/details/39053859Currently the latest release of POI is 3.10_final. This version of the jar package is protected by:
Maven Artifactid
Prerequisites
JAR
Poi
Commons-logging, Commons-codec, log4j
Poi-version-yyyymmdd.jar
Poi-scratchpad
Poi
Poi-scratchpad-version-yyyymmdd.jar
Poi-ooxml
POI, Poi-ooxml-schemas
Copy-on-write abbreviation Cow, is a kind of optimization strategy used in program design. The basic idea is that from the beginning everyone is sharing the same content, when someone wants to modify the content, it will really copy the content to form a new content and then change, this is a delay lazy strategy. Starting with JDK1.5 Java Concurrency Package provides two concurrent containers implemented us
understanding of the main expedition this and the static. What does this represent? This represents the current object, so the current object is the object generated through new main () by calling Printvalue with new Main (). The static variable is enjoyed by the object, so the value of This.value in Printvalue is undoubtedly 33. The value inside the Printvalue method is a local variable and cannot be associated with this at all, so the output is 33. Always keep in mind that static member varia
The basic conversion from: http://www.blogjava.net/ocean07000814/articles/331694.html
This article mainly describes how to deploy Java Web applications in Tomcat.Program. Because the focus is on how to deploy the service, we will not describe how to develop Web applications or start Tomcat servers, nor do we consider any development tools. In short, before proceeding with the examples mentioned in this ar
Section one Jackson Jackson technology and Java-json three types of jar packagescommon JSON libraries under Java are Gson, Json-lib and Jackson, and Jackson is relatively efficient, using Jackson for JSON and Java object transformations in the project. Here are some examples of how Jackson's JSON operations work. See U
.
These 31 refactoring methods are listed below "Note: The original is refactoring nth Day , that is, refactoring days N,sunny personally feel that some refactoring is very simple, one day too little, but addiction, so rename (Rename) for refactoring nth,, The plan is to repeat the 31 refactoring methods in the Java language, which are not exactly consistent with the original order, and add a lot of new content, ":
Refactoring 1:encapsulate Collect
The following issues occur with the Maven install and package in idea today: for org.apache.maven.plugins:maven-compiler-plugin:jar:3.1 is missing, no dependency information Available[warning] Error Injecting:org.apache.maven.plugin.compiler.CompilerMojojava.lang.NoClassDefFoundError: ORG/codehaus/plexus/compiler/util/scan/mapping/suffixmapping for org.apache.maven.plugins:maven-resources-plugin:jar:2.6 is
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.