The static clause of a class executes when the class is first loaded.
public class TestClass {
/**
* @param args
*
/public static void main (string[] args) throws Exception {
new Test1 ();
New Test1 ();
Class.forName
There are already encapsulated MD5 in the Java API that can be simply invoked if there is no special need
Import Java.security.MessageDigest;Import java.security.NoSuchAlgorithmException;
Class Toolkit { public static void Main (String []args) {
I am a small slag, engaged in Java development time is not long, the following mentioned questions only represent personal opinion, what is unreasonable place also hope that the great God said, thank you
Okay, here's the job:
Interview as the only
Today, the written code is tested on Ubuntu and a few problems are found.
1: Every time svn update source, after the tomcat redeployment log files will disappear ~ ~
View Source Discovery:
Java.util.logging.FileHandler private void Configure ()
public static void Testgetorset (list List) throws Introspectionexception, IllegalArgumentException, Illegalaccessexception, invocationtargetexception{
Class tclass = list.get (0). GetClass ();
Get all the properties of the class
Search on the network to quickly calculate the number of lines of text, are basically the following methods
Long filelength = File.length ();
Linenumberreader.skip (filelength);
Linenumberreader.getlinenumber
But the results of the run found that
Package zhangtingting; public class Stacktest {private object[] stack;//number of elements; private int size;///default length to public stacktest () {this (10);}//can also To set its own length, that is, capacity; Public stacktest (int len) {stack =
1 Error code: Input file Key class is longwritable, and text does not match
Error Reason: Originally set the program's input file for sequence file, the generated test data is text file, and the text file's key is the offset of the line, for
The Threadlocal class provides a place for each thread to store local variables.
Essentially, each currently running thread holds a map,threadlocal class that encapsulates access to the map, so that a new generated object can be placed into the
The biggest feature of set is the ability to remove duplicate elements and get the corresponding data, look at a simple code, the first use QBC query all employees, filter out the duplication of employees in the department, and finally get all the
Start tomcat times wrong:
Java.lang.NoSuchMethodError:org.apache.log4j.Category.log (ljava/lang/string; Lorg/apache/log4j/level; Ljava/lang/object; ljava/lang/throwable) V at
Org.apache.commons.logging.impl.Log4JCategoryLog.error
To solve this problem to note: Find the recursive method body, recursive export.
Package com.cc; /**** There are a pair of rabbits, from the third month after the birth of a pair of rabbits each month, the rabbit long to the third month after the
Java add text to a picture
Recently developed to realize to the picture Add text function, this plan uses Jmagick to realize, but the Chinese appears garbled, did not find a solution, use
The most original way to achieve, if you know jmagick
Engaged in Java programming so eight years, engaged in video advertising has more than five years, feeling accumulated a lot of technical and advertising industry experience, and then when the expression is found not to express, the end of the
by large to small need to cast, from small to large do not need
Precision from small to large order: Byte,short,char-> int-> long-> float-> double
Compile Success
Float method () {
int i=1;
return i;
}
Compile error
int method2 () {
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