JavaдµÄÌ°³ÔÉß
ÈýÖÜÇ°£¬¾ÍÓëͬѧԼ¶¨ºÃÁË£¬»¨ÈýÖÜʱ¼äд¸öÌ°³ÔÉߣ¬¾ÍÓÃ×Ô¼ºÏÖÔÚËùѧµÄJava£¬ÎÒÏë¿ÉÒÔ°¡¡£Ñ§Ð£Àï½Ì²»³öʲô¶«Î÷£¬ÄǾÍ×Ô¼º¸ã°É£¡ÓÚÊÇÎÒÃÇÐÅÊĵ©µ©¿ªÊ¼Á˼¸Ìì¡£²»ÁÏÎåÒ»Ò»À´£¬°ÑËùÓеĶ¼ÀÏÂÁË¡£×îºóÒ»ÖÜÁË£¬Ã»°ì·¨£¬Í¨Ïü°É£¡ÓÚÊÇÁ¬Ðø¼¸Ìì¿à¸É£¬ÖÕÓÚд³öÀ´ÁË.ËäÈ»Óеã´Ö²Ú£¬ÒòΪѧУ»¹Ã»¿ªÊ¼½ÌGUIºÍỊ̈߳¬ÒÔºóÎÒ»á¸ÄÉÆÕâ´úÂëµÄ
import java.awt.*;
import java.awt.event.*;
import java.util.*;
//===================¸ÃÀàÊÇ¿ØÖÆÉßÒƶ¯µÄ´°¿Ú===================================================
class snakeCanvas extends Panel implements Runnable, KeyListener
{
private Label b[] ; //ÉßµÄÖ÷Ìå
private Button food ; // ʳÎï
private Thread thread; //Ïß³Ì
private int count = 1, i; //count±íʾÉßµÄÊýÁ¿
private int xFood, yFood ; //±íʾʳÎïµÄ×ø±ê
private int x = 5, y = 0; //¿ØÖÆÉßÍ·µÄ×ø±ê
private boolean up = false, down = false, right = true, left = false; //ÓÃÀ´¿ØÖÆÉߵķ½Ïò
private boolean Game = true ; // ÅжÏÓÎÏ·ÊÇ·ñ½áÊø
snakeCanvas()
{
setSize( 510, 515 );
thread = new Thread(this);
setLayout(null);
setBackground(Color.green); //ÉèÖñ³¾°ÑÕÉ«
b = new Label[50] ;
//¶ÔÉߵijõʼ»¯
for ( int i = 0; i < 30; i++ )
{
b[i] = new Label("¿Ú") ;
b[i].setSize( 10, 10 ) ;
}
b[0].setBounds(5, 0, 10, 10);
add(b[0]); //Ìí¼Ó×é¼þ
//====================ʳÎïµÄËæ»ú×ø±ê=================================
xFood = 10*(int)( ( Math.random() + 0.01 ) * 50 ) + 5 ;
yFood = 10*(int)( ( Math.random() + 0.01 ) * 50 ) ;
}
public void keyTyped( KeyEvent e){}
public void keyReleased(KeyEvent e){}
//=========¼üÅÌʼþ=========================
public void keyPressed(KeyEvent e)
{
&nbs
Ïà¹ØÎĵµ£º
Õâ¶Îʱ¼äÔÚ×¢²áÓòÃû£¬ÔÛÆð²½Íí£¬ºÃÓõÄÓòÃû¶¼¸ø±ðÈË×¢²áÁË¡£
ÏëÕÒ¸öλÊýÉÙµÄ.comÓòÃû£¬¿ÉÊÇ·¢Ïִ󲿷ֶ¼×¢²áÁË£¬Ò²¾ÍÊÇ˵£¬ÎÒµã»÷µÄ¶à´Î²éѯ¶¼ÊÇÀË·Ñ¿¨Â·ÀÎҿɲ»Ïë¼õ·Ê£©
ÓÚÊÇ»¨Á˵ãʱ¼ä£¬ÓÃjavaдÁ˸ö¸ù¾ÝÖ¸¶¨Î»Êý²éѯËùÓпÉÓõÄ.comÓòÃûµÄС³ÌÐò¡£ÌṩԴÂëÏÂÔØ¡£
ÎÒÀûÓõÄÊÇwhoisÕâ¸öÓòÃû²éѯÍøվȡµÃÊý¾Ý£¬ÔÚ²âÊÔµ ......
ÔÚJSPÀ»ñÈ¡¿Í»§¶ËµÄIPµØÖ·µÄ·½·¨ÊÇ£ºrequest.getRemoteAddr£¨£©£¬ÕâÖÖ·½·¨Ôڴ󲿷ÖÇé¿ö϶¼ÊÇÓÐЧµÄ¡£µ«ÊÇÔÚͨ¹ýÁËApache£¬SquidµÈ·´Ïò´úÀíÈí¼þ¾Í²»ÄÜ»ñÈ¡µ½¿Í»§¶ËµÄÕæʵIPµØÖ·ÁË¡£
¡¡¡¡
Tag£ºJava ¿Í»§¶Ë ÕæʵIPµØÖ·
ÔÚJSPÀ»ñÈ¡¿Í»§¶ËµÄIPµØÖ·µÄ·½·¨ÊÇ£ºrequest.getRemoteAddr£¨£©£¬ÕâÖÖ·½·¨Ôڴ󲿷ÖÇé¿ ......
public static String splitAndFilterString(String input, int length) {
if (input == null || input.trim().equals("")) {
&nb ......
JAVA ´úÂëÈçÏ£º
<%
// µÃµ½Òª×ª»»µÄÊý×é---µ±È»ÕâÀïÒ²¿ÉÒÔÊÇÆäËûÀàÐ͵ÄÊý×é
List jsList = (List) request.getAttribute("gczbh");
%>
JS ´úÂëÈçÏ£º
<script type="text/javascrip ......
JavaÉè¼Æģʽ֮Singletonµ¥Àýģʽƪ
java µ¥ÀýģʽµÄʵÏÖ·½Ê½
ʵÏÖ1£º
public class Singleton {
private static Singleton instance;
private Singleton (){ //Ê×ÏÈÓÐÒ»¸ö˽ÓеĹ¹ÔìÆ÷
}
  ......