JAVAʵÏÖµÄħ·½
δÍê³É ´ýÍêÉÆ
public class MagicCube {
/**
* Áù¸öÃæµÄϱêÖµ
* ¡õ5
* ¡õ¡õ¡õ¡õ 1234 ÕâËĸöÁ¬ÌåÕý·½ÐÎÏòºó˳ʱÕë°üΧ ÐγÉͲ״ È»ºó °Ñ5ºÍ6¿ÛÉÏ ¾ÍÐγÉÕý·½Ìå
* ¡õ6
*/
public static void main(String[] args) {
MagicCube mb = new MagicCube();
int i = 0;
for (Face f : mb.faces) {
int index = 0;
System.out.printf("ÕâÊǵÚ%d¸öÃæ:\n",++i);
System.out.printf("%d_%d_%d\n",f.value[index++],f.value[index++],f.value[index++]);
System.out.printf("%d_%d_%d\n",f.value[index++],f.value[index++],f.value[index++]);
System.out.printf("%d_%d_%d\n",f.value[index++],f.value[index++],f.value[index++]);
int[] tmp = f.getColumn(2);
System.out.printf("ÁÙʱ%d_%d_%d\n",tmp[0],tmp[1],tmp[2]);
f.setColumn(2,new int[]{1,2,3});
tmp = f.getColumn(2);
System.out.printf("ÁÙʱ%d_%d_%d\n",tmp[0],tmp[1],tmp[2]);
index = 0;
System.out.printf("Ð޸ĺó%d_%d_%d\n",f.value[index++],f.value[index++],f.value[index++]);
System.out.printf("Ð޸ĺó%d_%d_%d\n",f.value[index++],f.value[index++],f.value[index++]);
System.out.printf("Ð޸ĺó%d_%d_%d\n",f.value[index++],f.value[index++],f.value[index++]);
}
}
public List<Face> faces = new ArrayList<Face>(6);
MagicCube(){
initData();
}
public static final int CURRENT = 1;
public static final int LEFT = 4;
public static final int RIGHT = 2;
public static final int TOP = 5;
public static final int BOTTOM = 6;
public static final int BACK = 3;
class Face{
public int[] value = new int[9];
Face(){}
Face(int[] value){
if(this.value.length == value.length)
this.value = value;
}
int getBackIndex(int side){
switch(side){
case(1): return 3;
case(3): return 1;
case(2): return 4;
case(4): return 2;
case(5): return 6;
case(6): return 5;
default: return -1;
}
}
/**
* »ñÈ¡µ±Ç°ÃæµÄµÚNÐ
Ïà¹ØÎĵµ£º
ÒòΪÔÚ×öÁ´½ÓÀ´Ô´Í³¼ÆµÄʱºòÐèÒª°Ñ http://www.baidu.com/baidu?word= ... B%F7&tn=myie2dg ÕâÀàµÄURL±àÂ뻹ԳÉÃ÷ÎÄ×Ö´®£¬Ò»°ã´ó²¿·ÖµÄÍøÕ¾¶¼ÊÇÓÃÆÕͨµÄURL±àÂëÐÎʽ£¬ÈçÉÏÃæÁ´½ÓÖеÄbadu£¬ÕâÖַdz£ÈÝÒ×ת»»ºÍ»¹Ô£¬Java°üÀïÌṩÁËÁ½¸öÀàµÄ²»Í¬·½·¨URLEncode.encode()ºÍURLDecode.decode()Äܷdz£·½±ãʵÏÖ£¬µ ......
DOMÊÇ»ùÓÚƽ̨¡¢ÓïÑÔÎ޹صĹٷ½W3C±ê×¼¡£»ùÓÚÊ÷µÄ²ã´Î£¬ÆäÓŵãÊÇ¿ÉÒÔÒÆÖ²£¬±à³ÌÈÝÒ×£¬¿ª·¢ÈËÔ±Ö»ÐèÒªµ÷Óý¨Ê÷µÄÖ¸Áî¡£ÆäȱµãÊǼÓÔØ´óÎļþ²»ÀíÏë¡£
¡¡¡¡SAXÊÇ»ùÓÚʼþÄ£Ð͵ģ¬ËüÔÚ½âÎö XML ÎĵµµÄʱºò¿ÉÒÔ´¥·¢Ò»ÏµÁеÄʼþ£¬µ±·¢ÏÖ¸ø¶¨µÄtagµÄʱºò£¬Ëü¿ÉÒÔ¼¤»îÒ»¸ö»Øµ÷·½·¨£¬¸æË߸÷½·¨Öƶ¨µÄ±êÇ©ÒѾÕÒµ½¡£ÀàËÆÓëÁ÷ýÌåµÄ½ ......
¹ØÓÚJava
µÄµ×²ãÒ»Ö±Ïëдµãʲô£¬µ«ÊǺÃÏñºÜ¶àÎÊÌâÔÚÍøÉÏ»¹ÊÇ¿ÉÒÔÕҵõ½´ð°¸£¬×îºó»¹ÊǾö¶¨Ð´³öÀ´£¬Ò»À´¿ÉÒÔÈÃ×Ô¼ºÖØÎÂһϣ¬¶þÀ´¿ÉÒԺʹó¼ÒÒ»ÆðÉîÈë̽ÌֵײãµÄ֪ʶ¡£ÕâÀïÃ滹ÓÐһЩ³£¼ûµÄСÎÊÌ⣬Ҳ¸½´øÔÚÀïÃæµÄÔÒò£¬framework
ÆäʵҲÊǹ¹½¨ÔÚÕâЩ֪ʶµÄ»ù´¡Éϵġ£
ÂÛÒ»£ºÊýÖµÂÛ
ÎÊÌâÒ ......
Ò»¸öJava´°¿Ú´ø°´¼ü¼ì²â£¨ÅÜJava¿ÉÊÓС³ÌÐòʱÓã©£¬沒¼ÓÐÞÊΣ¬°³×Ô¼ºÓõΡ£
package math;
import java.awt.Color;
import java.awt.Frame;
import java.awt.Graphics;
import java.awt.event.KeyEvent;
import java.awt.event.KeyListener;
/**
* »ù±¾µÄ»æͼ´°¿Ú£¬»Ø³µ¹Ø±Õ´°¿Ú
*/
@SuppressWarnings("s ......
package debug;import java.io.*;import java.lang.Thread;class MyThread extends Thread{ public int x = 0; public void run(){ System.out.println(++x); }}class R implements Runnable{ private int x = 0; public void run(){ System.out.printl ......