in the Java language, when an object is created, the Java Virtual machine assigns it a pointer to the object itself, and this pointer is "this".
Use this to call the member variable (property) in this class use this to invoke the constructor to
Because the project needs, you need to use Graphics2D to draw line graphics
But without doing the processing, the drawn lines have a severe sawtooth that looks very ugly, as shown in figure:
The code that smooths the line is as follows:
/**
* 1, the null judgement of the string org.aphche.commons.lang.StringUtils
*/
Checks If a String is empty ("") or null.
SYSTEM.OUT.PRINTLN (Stringutils.isempty (null)); True
System.out.println (Stringutils.isempty (""));
1 Anonymous inner class is the simplified writing of inner class
2 premise, there is a class or interface
3 format: New class name or interface name () {
Override method ...
}
4 Benefits: Recycling is the end of the use. Take up less memory.
Code on:
1, using the construction method new Arraylist<> (srclist):
Listsrclist = new arraylist<> ();
for (int i=0;i
Useru = new User (Long.parselong (i+ ""), "Test" +i);
Srclist.add (U);
}
System.out.println ("src:");
System.out.println (Srclist.tostring ()
do not remove/add the element in the Foreach loop. remove element Use iterator method, if concurrent operation, need to lock iterator object. Test One:
list list = new arraylist ();
List.add ("AAAAA");
List.add ("bbbb");
for
Package com.xxxx.service;
Import Java.io.BufferedInputStream;Import Java.io.FileOutputStream;Import java.io.IOException;Import java.net.HttpURLConnection;Import Java.net.URL;
/**** Java access URL and download files* To access the analysis system
First, the source code
/*To receive user input numbers on the consoleby csdn--Yue Procedure-Siege Lion2014.11.25*/Import Java.util.Scanner;public class receiveinput{public static void Main (string[] args) {Scanner scan = new Scanner (system.in);
Nonsense not much to say, directly on the code:
Import Java.io.File;/** Recursive algorithm to traverse the folder, print out all exe file file name*/public class Traversefolder {Recursive method-"foldername: The name of the file (folder) to
Class Serializationutils {private Serializationutils () {throw new unsupportedoperationexception ();
public static void WriteObject (Serializable s, String filenameandpath) {objectoutputstream OS = null;
try {os = new ObjectOutputStream (new
1 Java has a thing called garbage collector, it lets the object that creates does not need like c/cpp to delete, free drop, you can talk about, GC is at when, to what thing, do what thing.
one, how GC.The GC is a separate thread that is
Java Usage Packages (package) This mechanism is designed to prevent naming conflicts, access control, and provide search and positioning classes (class), interfaces, enumerations (enumerations), and annotations (annotation).The concept of Java
1. Java.lang class Integer
Method: public static int parseint(String s)
Description: Parses the string argument as a signed decimal integer. The characters in a string must be decimal digits except that the first character can be used to represent
Java read binary file is not difficult, before the Internet read a lot of articles are foggy, this time to a clear
First, the file is defined as the filename = new ("F:/marketinfo");
Then define the file stream FileInputStream in = new
//if the browser is running, you do not need to write webcontent/the String path = "Webcontent/config";
File File = new file (path);
file[] templist = File.listfiles ();
System.out.println ("Number of objects in this folder directory:"
Reentrantlock is a lock that supports re-entry, which means that the lock supports a thread's repeated lock on the resource, which in addition supports the fairness and unfairness of the acquisition lock. 1 The realization of the re-entry
For the
Java reads a CSV file and uses JDBC to insert the content into the database, the class that inserts the database can be viewed in another article, there is a common CSV operation jar Package, this article does not
Before writing the C # project, it is convenient to redo the list, using List1. Union (List2). ToList () can (enumerable.union). And, if you want to remove the List2 item from the List1, it is also convenient, list2. Except (List1). ToList ()
Now
In the writing of multithreaded programs, it is often possible to encounter the concurrentmodificationexception exception, which means that there is a concurrent modification of the situation, in order to reduce the performance of the program, the
First, traversing the map has the following methods:
Import Java.util.HashMap;
Import Java.util.Iterator;
Import Java.util.Map; public class Maptest {public static void main (string[] args) {map Map = new H
Ashmap ();
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