ÀûÓÃJava API¶Ô×Ö·û´®½øÐмÓÃܽâÃÜ£¨DES¼ÓÃÜËã·¨£©
/*Decryptor*/
import javax.crypto.Cipher;
import javax.crypto.SecretKey;
import javax.crypto.SecretKeyFactory;
import javax.crypto.spec.DESKeySpec;
/**
* Decrypt the password get form Xpress GUI
*/
public class Decryptor{
//¼ÓÃÜ
private static byte[] encrypt(int mode, byte[] password) {
try {
DESKeySpec desKeySpec = new DESKeySpec("KEY".getBytes());
SecretKeyFactory secretKeyFactory = SecretKeyFactory.getInstance("DES");
SecretKey secretKey = secretKeyFactory.generateSecret(desKeySpec);
Cipher cipher = Cipher.getInstance("DES");
cipher.init(mode, secretKey);
return cipher.doFinal(password);
} catch (Exception e) {
return password;
}
}
//½âÃÜ
public static String decrypt(String[] args) {
int length = args.length;
byte[] b = new byte[length];
for(int i = 0; i < length; i++){
b[i] = new Byte(args[i]);
}
return new String(encrypt(Cipher.DECRYPT_MODE, b));
}
}
Ïà¹ØÎĵµ£º
public class Fibonacci {
/**
* @param args
*/
public static void main(String[] args) {
// TODO Auto-generated method stub
NumOfFibonacci(9);
}
public static int MyFibonacci(int i){
if(i>0) {
if(i == 1)return 1;
if(i == 2)return 1;
else return MyFibonacc ......
JAVAµÄ¿çƽ̨µÄÌØÐÔÉîÊÜjava³ÌÐòÔ±ÃǵÄϲ°®,µ«ÕýÊÇÓÉÓÚËüΪÁËʵÏÖ¿çƽ̨µÄÄ¿µÄ,ʹµÃËüºÍ±¾µØ»úÆ÷µÄ¸÷ÖÖÄÚ²¿ÁªÏµ±äµÃºÜÉÙ,´ó´óÔ¼ÊøÁËËüµÄ¹¦ÄÜ,±ÈÈçÓëһЩӲ¼þÉ豸ͨÐÅ,ÍùÍùÒª»¨·ÑºÜ´óµÄ¾«Á¦È¥Éè¼ÆÁ÷³Ì±àд´úÂëÈ¥¹ÜÀíÉ豸¶Ë¿Ú,¶øÇÒÓÐһЩÉ豸³§ÉÌÌṩµÄÓ²¼þ½Ó¿ÚÒѾ¾¹ýÒ»¶¨µÄ·â×°ºÍ´¦Àí,²»ÄÜÖ±½ÓʹÓÃjava³ÌÐòͨ¹ý¶Ë¿Úº ......
½Ó¿ÚÖв»¿ÉÒÔ¶¨Òå¹¹Ôì·½·¨
½Ó¿ÚÖÐÖ»ÄÜÓÐ public static final µÄ±äÁ¿ ºÍ public abstract µÄ·½·¨£¬ÆäËü¶¼²»¿ÉÒÔ¡£
ÀýÈ磺
´úÂëÀïÊÇÕâÑùдµÄ
public interface B{
StringBuilder sb=null;
void fun();
& ......
import java.net.URL;
import java.net.URLDecoder;
public class PathUtil
{
/**
* Get the env of windir, such as "C:\WINDOWS".
* @return the env of windir value.
*/
public static String getWindir(){
return System.getenv("windir");
}
......
ÎÊÌâÃèÊö
Exception in thread "main" java.lang.OutOfMemoryError:
Java heap space
½â¾ö·½°¸[ת]
Ò»Ö±¶¼ÖªµÀ¿ÉÒÔÉèÖÃjvm heap´óС£¬Ò»Ö±ÓÃeclipseд/µ÷ÊÔjava³ÌÐò¡£Ò»Ö±ÓÃÃüÁîÐÐor
console¼Ó²ÎÊýÅܳÌÐò¡£ÏÖÏó£ºÔÚeclipseµÄÅäÖÃÎļþeclipse.iniÖÐÉèÖÃ-vmargs -Xms500m
-Xmx1024m
£¬ÔÚeclipseÖ ......