Ò׽ؽØͼÈí¼þ¡¢µ¥Îļþ¡¢Ãâ°²×°¡¢´¿ÂÌÉ«¡¢½ö160KB

java½øÖÆת»»

¶ÔÓÚ10½øÖÆÊýת»»ÎªN£¨2-36£©½øÖÆÒ»°ã¶¼ÊÇÑ¡ÔñÈ¡Óà³ýµÄËã·¨½øÐÐת»» £¬ÏÂÃæ¸ø³öÁ½ÖÖ·½°¸
Ò»ÖÖÊǵݹ飬һÖÖÊǵü´ú¡£Í¨¹ýЧÂÊÆÀ¼ÛÁ½ÕßÐÔÄÜ
ÆäÖеü´úµÄ·½°¸Ö±½ÓÈ¡×ÔjavaÔ´´úÂë¡£
/*
*Class NotationConvert.java
*Create Date: 2009-11-12
*Author:a276202460
*/
package com.rich.notation;
public class NotationConvert {
private static final String[] letters = { "0", "1", "2", "3", "4", "5",
"6", "7", "8", "9", "a", "b", "c", "d", "e", "f", "g", "h", "i",
"g", "k", "l", "m", "n", "o", "p", "q", "r", "s", "t", "u", "v",
"w", "x", "y", "z" };
static final char[] digits = { '0', '1', '2', '3', '4', '5', '6', '7', '8',
'9', 'a', 'b', 'c', 'd', 'e', 'f', 'g', 'h', 'i', 'j', 'k', 'l',
'm', 'n', 'o', 'p', 'q', 'r', 's', 't', 'u', 'v', 'w', 'x', 'y',
'z' };
public static String TentoN(int value, int number) {
if (number <= 1 || number > letters.length) {
throw new RuntimeException("Faild");
}
if (value < 0) {
return "-" + TentoN(0 - value, number);
}
if (value < number) {
return letters[value];
} else {
return (TentoN(value / number, number) + letters[value % number]);
}
}
public static String TentoN1(int value, int number) {
if (number <= 1 || number > letters.length) {
throw new RuntimeException("Faild");
}
char[] rs = new char[33];
boolean flag = value < 0;
int startindex = 32;
if (!flag)
value = 0 - value;
for (; value <= -number; value /= number)
rs[startindex--] = digits[-(value % number)];
rs[startindex] = digits[-value];
if (flag) {
rs[--startindex] = '-';
}
return new String(rs, startindex, 33 - startindex);
}

public static void main(String[] s) {
long starttime = System.currentTimeMillis();
for (int i = 0; i < 100000; i++)
TentoN(-33, 2);
System.out.println((System.currentTimeMillis() - starttime));
starttime = System.currentTimeMillis();
for (int i = 0; i < 100000; i++)
TentoN1(-33, 2);
System


Ïà¹ØÎĵµ£º

javaÖеÄforeachÓ÷¨

 import java.util.*;
public class ForeachExample {
/**
* @param args
*/
public static void main(String[] args) {
// TODO Auto-generated method stub
Random r = new Random();
int[] x = new int[10];
for (int i = 0; i < x.length; i++) {
x[i] = r.nextInt(100);
}
/ ......

javaÖÐthis¹Ø¼ü×ÖÓ÷¨

 /**
* this¹Ø¼ü×ÖÓ÷¨
*/
public class Flower {

int petalCount = 0;
String s = "initial value";

Flower(int petals){
petalCount = petals;
System.out.println("Constructor with one int arg");
}

Flower(String ss){
System.out.println("Constr ......

JavaÅàѵ×ܽá

1¡¢  Web.xml
1£©  ÅäÖÃhibernate
<context-param>
       <param-name>contextConfigLocation</param-name>
       <param-value>/WEB-INF/dbConnectionContext.xml /WEB-INF/serviceContext.xml</param-value> ......

java.lang.OutOfMemoryError: Java heap space

 
ÎÊÌâÃèÊö
Exception in thread "main" java.lang.OutOfMemoryError:
Java heap space
½â¾ö·½°¸[ת]
Ò»Ö±¶¼ÖªµÀ¿ÉÒÔÉèÖÃjvm heap´óС£¬Ò»Ö±ÓÃeclipseд/µ÷ÊÔjava³ÌÐò¡£Ò»Ö±ÓÃÃüÁîÐÐor
console¼Ó²ÎÊýÅܳÌÐò¡£ÏÖÏó£ºÔÚeclipseµÄÅäÖÃÎļþeclipse.iniÖÐÉèÖÃ-vmargs -Xms500m
-Xmx1024m
£¬ÔÚeclipseÖ ......

ÀûÓÃ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{
  
//¼ÓÃÜ    
  ......
© 2009 ej38.com All Rights Reserved. ¹ØÓÚE½¡ÍøÁªÏµÎÒÃÇ | Õ¾µãµØͼ | ¸ÓICP±¸09004571ºÅ