javaµÝ¹éʵÏÖººÅµËþ
/*
* ººÅµËþ£¬´ÓµÚ1¸öÖù×Ó½èÖúµÚ2¸ùÖù×ÓÒƶ¯µ½µÚ3¸ù
*/
public class TowerOfHano {
private int totle;//×ܹ²ÅÌ×ÓÊýÄ¿
public TowerOfHano(int totle){
this.totle=totle;
}
private void moveOne(int start,int end){
System.out.println("´Ó"+start+"Òƶ¯Ò»¿éÅÌ×Óµ½"+end);
}
private void moveAll(int totle,int start,int temp,int end){
if(totle==1){
moveOne(start,end);
}else{
moveAll(totle-1,start,end,temp);
moveOne(start,end);
moveAll(totle-1,temp,start,end);
}
}
public static void main(String[] args) {
TowerOfHano tower = new TowerOfHano(3);//²âÊÔÈý¿éÅÌ×Ó
tower.moveAll(tower.totle, 1, 2, 3);
}
}
Ïà¹ØÎĵµ£º
Java²»ÊÇÍêÃÀµÄ£¬JavaµÄ²»×ã³ýÁËÌåÏÖÔÚÔËÐÐËÙ¶ÈÉÏÒª±È´«Í³µÄC++ÂýÐí¶àÖ®Í⣬JavaÎÞ·¨Ö±½Ó·ÃÎʵ½²Ù×÷ϵͳµ×²ã£¨ÈçϵͳӲ¼þµÈ)£¬Îª´ËJavaʹÓÃnative·½·¨À´À©Õ¹Java³ÌÐòµÄ¹¦ÄÜ¡£
¡¡¡¡¿ÉÒÔ½«native·½·¨±È×÷Java³ÌÐòͬ£Ã³ÌÐòµÄ½Ó¿Ú£¬ÆäʵÏÖ²½Ö裺
¡¡¡¡£±¡¢ÔÚJavaÖÐÉùÃ÷native()·½·¨£¬È»ºó±àÒ룻
¡¡¡¡£²¡¢ÓÃjavah²úÉúÒ»¸ö.hÎ ......
һЩjavaÀàÖÐΪʲôÐèÒªÖØÔØ serialVersionUID ÊôÐÔ¡£
ÔÚJavaÖУ¬Èí¼þµÄ¼æÈÝÐÔÊÇÒ»¸ö´óÎÊÌ⣬ÓÈÆäÔÚʹÓõ½¶ÔÏó´®ÐÐÐÔµÄʱºò£¬ÄÇôÔÚijһ¸ö¶ÔÏóÒѾ±»´®Ðл¯ÁË£¬¿ÉÊÇÕâ¸ö¶ÔÏóÓÖ±»Ð޸ĺóÖØв¿ÊðÁË£¬ÄÇôÔÚÕâÖÖÇé¿öÏ£¬ ÓÃÀÏÈí¼þÀ´¶ÁÈ¡ÐÂÎļþ¸ñʽËäÈ»²»ÊÇʲôÄÑÊ£¬µ«ÊÇÓпÉÄܶªÊ§Ò»Ð©ÐÅÏ¢¡£
serialVersionUID À´½â¾öÕâЩΠ......
Java´®¿ÚͨѶ
´®ÐÐͨѶÐÒéÓкܶàÖÖ£¬ÏñRS232£¬RS485£¬RS422£¬ÉõÖÁÏÖ½ñÁ÷ÐеÄUSBµÈ¶¼ÊÇ´®ÐÐͨѶÐÒé¡£¶ø´®ÐÐͨѶ¼¼ÊõµÄÓ¦ÓÃÎÞ´¦²»ÔÚ¡£¿ÉÄÜ´ó¼Ò¼ûµÄ×î¶à¾ÍÊǵçÄԵĴ®¿ÚÓëModemµÄͨѶ¡£¼ÇµÃÔÚPC»ú¸Õ¿ªÊ¼ÔÚÖйúÁ÷ÐÐÆðÀ´Ê±(´óÔ¼ÊÇÔÚ90Äê´úÇ°ÎåÄê)£¬ÄÇʱÉõÖÁÓÐÈËÓÃÒ»Ìõ´®ÐÐÏß½øÐÐÁ½Ì¨µçÄÔÖ®¼äµÄ ......
import java.awt.Color;
import java.awt.Font;
import java.awt.Graphics;
import java.awt.Graphics2D;
import java.awt.Image;
import java.awt.font.TextAttribute;
import java.awt.image.BufferedImage;
import java.io.FileOutputStream;
import java.text.AttributedCharacterIterator;
import java.text. ......