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

¼ÙÆÚûÊÂ,дÁ˸ö90ÐеĶíÂÞ˹·½¿é,JavaʵÏÖ

import java.awt.*;
import java.awt.event.*;
import javax.swing.*;
public class Terris extends JFrame implements Runnable, KeyListener {
private short isPlaying=0,xOffSet = 2, yOffSet = 0, blockType = (short) Math.round(Math.random() * 6), blockRotation = 0, blockColor = (short) Math.round(Math.random() * 5);
private short matrix[][] = new short[21][10];//
private short block[][][][] = {{{ { 0, 1, 0, 0 }, { 0, 1, 0, 0 }, { 0, 1, 0, 0 },{ 0, 1, 0, 0 } },/* l */{ { 0, 0, 0, 0 }, { 1, 1, 1, 1 }, { 0, 0, 0, 0 },{ 0, 0, 0, 0 } } },/*-*/{{ { 0, 0, 0, 0 }, { 1, 1, 0, 0 }, { 0, 1, 1, 0 },{ 0, 0, 0, 0 } },/* z */{ { 0, 0, 0, 0 }, { 0, 0, 1, 0 }, { 0, 1, 1, 0 },{ 0, 1, 0, 0 } } },/* z| */{{ { 0, 0, 0, 0 }, { 0, 1, 1, 0 }, { 1, 1, 0, 0 },{ 0, 0, 0, 0 } },/* xz */{ { 0, 1, 0, 0 }, { 0, 1, 1, 0 }, { 0, 0, 1, 0 },{ 0, 0, 0, 0 } } },/* xz| */{ { { 0, 0, 0, 0 }, { 0, 1, 1, 0 }, { 0, 1, 1, 0 }, { 0, 0, 0, 0 } } },/** []*/{{ { 0, 1, 1, 0 }, { 0, 1, 0, 0 }, { 0, 1, 0, 0 },{ 0, 0, 0, 0 } },{ { 0, 0, 0, 0 }, { 1, 1, 1, 0 }, { 0, 0, 1, 0 },{ 0, 0, 0, 0 } },{ { 0, 1, 0, 0 }, { 0, 1, 0, 0 }, { 1, 1, 0, 0 },{ 0, 0, 0, 0 } },{ { 1, 0, 0, 0 }, { 1, 1, 1, 0 }, { 0, 0, 0, 0 },{ 0, 0, 0, 0 } } },/* f */{{ { 1, 1, 0, 0 }, { 0, 1, 0, 0 }, { 0, 1, 0, 0 },{ 0, 0, 0, 0 } },{ { 0, 0, 1, 0 }, { 1, 1, 1, 0 }, { 0, 0, 0, 0 },{ 0, 0, 0, 0 } },{ { 0, 1, 0, 0 }, { 0, 1, 0, 0 }, { 0, 1, 1, 0 },{ 0, 0, 0, 0 } },{ { 0, 0, 0, 0 }, { 1, 1, 1, 0 }, { 1, 0, 0, 0 },{ 0, 0, 0, 0 } } },/* xf */ {{ { 0, 1, 0, 0 }, { 1, 1, 1, 0 }, { 0, 0, 0, 0 },{ 0, 0, 0, 0 } },{ { 0, 1, 0, 0 }, { 0, 1, 1, 0 }, { 0, 1, 0, 0 },{ 0, 0, 0, 0 } },{ { 0, 0, 0, 0 }, { 1, 1, 1, 0 }, { 0, 1, 0, 0 },{ 0, 0, 0, 0 } },{ { 0, 1, 0, 0 }, { 1, 1, 0, 0 }, { 0, 1, 0, 0 },{ 0, 0, 0, 0 } } } };/* t */
private Image[] images = {new ImageIcon("D:/Java/eclipse/workspace/Terris/src/img/Red.gif").getImage(),new ImageIcon("D:/Java/eclipse/workspace/Terris/src/img/Blue.gif").getImage(),new ImageIcon(("D:/Java/eclipse/workspa


Ïà¹ØÎĵµ£º

Java Web µÚ9Ìì jsp

Ò»¡¢
ΪʲôҪʹÓÃ
JSP
ÔÚ¿Í»§¶ËÍøÒ³±à³ÌÖÐ
Java
µÄ½â¾ö·½°¸ÊÇ
Servlet/JSP
¡£¶ÔÓÚ¶¯Ì¬Ò³ÃæµÄÐγÉÎÒÃÇ¿ÉÒÔÀûÓÃÔÚ
Servlet
Öбàд×Ö·û´®ÊµÏÖ£¬µ«ÊÇÕâÑù»áʹ³ÌÐòÔ±µÄ¹¤×÷±äµÃÒì³£µÄ·±Ëö£¬ËùÒÔÎÒÃDzÉÓÃ
JSP
´ïµ½ÍøÒ³µÄ¶¯Ì¬ÏÔʾ¡£
¶þ¡¢
ʲôÊÇ
JSP
JSP
£¨
JavaServerPage
£©ºÍ
Servlet
ÊÇ
Java
ÖвúÉú¶¯Ì ......

Effective Java ѧϰ±Ê¼Ç (11)

CloneÕâ¸ö·½·¨ºÜ¼¦Àߣ¬Ô­ÒòÊÇÒòΪËüÊÇÊܱ£»¤µÄ(protected)£¬Æä¶þCloneÕâ¸ö·½·¨ÊÇ¿ÉÑ¡µÄ£¬¼´ÓпÉÄÜÀàûÓÐÌṩÕâ¸ö·½·¨¡£
cloneûÓе÷Óù¹Ô캯Êý£¬¶øÇÒÈç¹û¸¸ÀàûÓÐʵÏÖcloneµÄ»°£¬×ÓÀàÓÀÔ¶Ò²²»¿ÉÄÜÕýȷʵÏÖclone.
×ÜÖ®£¬cloneÊǸöºÜÍ·Í´µÄº¯Êý£¬Èç¹ûÒªÕýȷʵÏÖ£¬±ØÐ뿼Âǵ½É±´µÄÇé¿ö£¬·ñÔò±»¿Ë¡³öÀ´µÄ¶ÔÏó¾Í²»ÊǶÀÁ¢µÄ ......

Java Web µÚÁùÌì ×÷ÓÃÓò¼°¼àÌýÆ÷

Ò»¡¢
web
µÄÈýÖÖ×÷ÓÃÓò
ServletContext(
ÉÏÏÂÎÄ
)
£ºÕû¸ö
web
Ó¦ÓóÌÐò£¬Ï̲߳»°²È«
HttpSession(
ȇȡ
)
£ºÒ»¸ö»á»°½»»¥¹ý³Ì
ServletRequest(
ÇëÇó
)
£ºÒ»´ÎÇëÇó¹ý³Ì
ÊôÐÔ²Ù×÷·½·¨£º
      

void setAttribute(String,Object)
       ......

Java Ö±½ÓÑ¡ÔñÅÅÐò

      Ö±½ÓÑ¡ÔñÅÅÐòËã·¨£º´Ó´ýÅÅÐòµÄÊý¾ÝÔªËؼ¯ºÏÖÐÑ¡È¡×îСµÄÔªËطŵ½Ô­Ê¼Êý¾ÝµÄµÚÒ»¸öÔªËصÄλÖÃÉÏ¡£È»ºó²»°üÀ¨µÚÒ»¸öÔªËصÄÊý¾ÝÔªËؼ¯ºÏÖÐÕÒµ½×îСµÄÔªËطŵ½´Ë¼¯ºÏÖУ¬ÒÀ´ÎÀàÍÆ£¬¼´¿ÉÍê³ÉÅÅÐò¡£
Ë㷨ʵÏÖÈçÏ£º
/**
* Ö±½ÓÑ¡ÔñÅÅÐò
* @param a ÓÃÓÚÅÅÐòµÄÊý×é
* */
public void ......
© 2009 ej38.com All Rights Reserved. ¹ØÓÚE½¡ÍøÁªÏµÎÒÃÇ | Õ¾µãµØͼ | ¸ÓICP±¸09004571ºÅ