java ÖеÄÑéÖ¤Âë
<%@ page language="java" import="java.util.*" pageEncoding="GBK"
import="java.awt.*,java.awt.image.*,javax.imageio.*"%><%
/*
ʹÓ÷½·¨£ºÔÚÐèÒªÏÔʾÑéÖ¤ÂëµÄhtml´úÂëÖÐʹÓÃ<img p">
ÔÚÐèÅжÏsessionµÄʱºòÅжÏsession.getAttribute("vcode")
*/try{
int codeLength=4;//ÑéÖ¤Â볤¶È
int mixTimes=0;//Ä£ºý³Ì¶È²ÎÊý
Color bgColor=getRandColor(200, 250);//±³¾°ÑÕÉ«
Color bfColor=new Color(0,0,0);//×ÖÌåÑÕÉ«
boolean ifRandomColor=true;//µ¥¸ö×Ö·ûÊÇ·ñÑÕÉ«Ëæ»ú
boolean ifMixColor=true;//Ä£ºýÏßÊÇ·ñÑÕÉ«Ëæ»ú
//ÉèÖÃÒ³Ãæ²»»º´æ
// ÔÚÄÚ´æÖд´½¨Í¼Ïó
int width = 13*codeLength+6, height = 20;
BufferedImage image = new BufferedImage(width, height,BufferedImage.TYPE_INT_RGB);
// »ñȡͼÐÎÉÏÏÂÎÄ
Graphics g = image.getGraphics();
// É趨±³¾°É«
g.setColor(bgColor);
g.fillRect(0, 0, width, height);
//É趨×ÖÌå
g.setFont(new Font("Times New Roman", Font.PLAIN, 18));
//»±ß¿ò
g.setColor(new Color(33,66,99));
g.drawRect(0,0,width-1,height-1);
// Ëæ»ú²úÉú¸ÉÈÅÏߣ¬Ê¹Í¼ÏóÖеÄÈÏÖ¤Âë²»Ò×±»ÆäËü³ÌÐò̽²âµ½
g.setColor(getRandColor(160, 200));
for (int i = 0; i < mixTimes*codeLength/10; i++) {
if(ifMixColor)
{
g.setColor(getRandColor(160, 200));
}
int x = random.nextInt(width);
int y = random.nextInt(height);
int xl = random.nextInt(12);
int yl = random.nextInt(12);
g.drawLine(x, y, x + xl, y + yl);
}
// È¡Ëæ»ú²úÉúµÄÈÏÖ¤Âë(4λÊý×Ö)
String sRand = "";
for (int i = 0; i < codeLength; i++) {
String rand = String.valueOf(random.nextInt(10));
sRand += rand;
// ½«ÈÏÖ¤ÂëÏÔʾµ½Í¼ÏóÖÐ
if(ifRandomColor)
g.setColor(getRandColor(20,110,0));
else
g.setColor(bfColor);
//µ÷Óú¯Êý
Ïà¹ØÎĵµ£º
ÀàµÄ³õʼ»¯ºÍ¶ÔÏó³õʼ»¯ÊÇ JVM ¹ÜÀíµÄÀàÐÍÉúÃüÖÜÆÚÖзdz£ÖØÒªµÄÁ½¸ö»·½Ú£¬Google ÁËÒ»±éÍøÂ磬ÓйØÀà×°ÔØ»úÖƵÄÎÄÕµ¹ÊDz»ÉÙ£¬È»¶øÀà³õʼ»¯ºÍ¶ÔÏó³õʼ»¯µÄÎÄÕ²¢²»¶à£¬ÌرðÊÇ´Ó×Ö½ÚÂëºÍ JVM ²ã´ÎÀ´·ÖÎöµÄÎÄÕ¸üÊÇÏÊÓÐËù¼û¡£
±¾ÎÄÖ÷Òª¶ÔÀàºÍ¶ÔÏó³õʼ»¯È«¹ý³Ì½øÐзÖÎö£¬Í¨¹ýÒ»¸öʵ¼ÊÎÊÌâÒýÈ룬½«Ô´´úÂëת»»³É JVM ×Ö½ÚÂëºó£¬ ......
Java 2 ƽ̨ÒýÈëÁË java.lang.ref °ü£¬ÆäÖаüÀ¨µÄÀà¿ÉÒÔÈÃÄúÒýÓöÔÏ󣬶ø²»½«ËüÃÇÁôÔÚÄÚ´æÖС£ÕâЩÀ໹ÌṩÁËÓëÀ¬»øÊÕ¼¯Æ÷£¨garbage collector£©Ö®¼äÓÐÏ޵Ľ»»¥¡£Peter Haggar ÔÚ±¾ÎÄÖзÖÎöÁË SoftReference ¡¢ WeakReference ºÍ PhantomReference ÀàµÄ¹¦ÄܺÍÐÐΪ£¬²¢¾ÍÕâЩÀàµÄʹÓøø³öÁËһЩ±à³Ì·ç¸ñÉϵĽ¨Òé¡£
µ±ÔÚ Ja ......
package ch01;
2
3public class BubbleSort
4{
5
6
7 public static void main(String[] args){
8 int[]& ......
JAVA IOÁ÷µÄÓ¦ÓÃ
IOÁ÷µÄµäÐÍÓ¦ÓÃ
¾¡¹Ü¿âÄÚ´æÔÚ´óÁ¿IOÁ÷À࣬¿Éͨ¹ý¶àÖÖ²»Í¬µÄ·½Ê½×éºÏµ½Ò»Æ𣬵«Êµ¼ÊÉÏÖ»Óм¸ÖÖ·½Ê½²Å»á¾³£Óõ½¡£È»¶ø£¬±ØÐëСÐÄÔÚÒâ²ÅÄܵõ½ÕýÈ·µÄ×éºÏ¡£ÏÂÃæÕâ¸öÏ൱³¤µÄÀý×ÓչʾÁ˵äÐÍIOÅäÖõĴ´½¨ÓëʹÓ㬿ÉÔÚд×Ô¼ºµÄ´úÂëʱ½«Æä×÷Ϊһ¸ö²Î¿¼Ê¹Óá£×¢Òâÿ¸öÅäÖö¼ÒÔÒ»¸ö×¢ÊÍÐ ......