java×Ü½á µÚËÄÕÂ
µÚËÄÕÂ
ÔËËã·û£¬±í´ïʽºÍÁ÷³Ì¿ØÖÆ
±äÁ¿ÓÃÓڼǼÊýÖµ¿É±äµÄÊý¾Ý
java±äÁ¿Ê¹ÓÃÇ°±ØÐëÏÈÉùÃ÷ºÍ³õʼ»¯
³ÉÔ±±äÁ¿ÔÚÀàµÄ¶¨ÒåÖÐÉùÃ÷
ÔÚ´´½¨¶ÔÏóµÄͬʱ´´½¨ÓйصijÉÔ±±äÁ¿
³ÉÔ±±äÁ¿´´½¨ºóϵͳ×Ô¶¯¶ÔÆä½øÐÐĬÈϳõʼ»¯ºÍÏÔʽ³õʼ»¯ ³ÉÔ±±äÁ¿ÒÀ¸½ÓÚ¶ÔÏó¶ø´æÔÚ
&&Óë ||»ò =¸³ÖµÔËËã·û
·ÖÖ§Óï¾ä
if else
int i;
switch(i)//caseÖеÄi±ØÐëΪÊýÖµ ¶ø¾ø²»ÄÜÊÇÈ¡Öµ·¶Î§
{ Èç¹ûÒªÇóÈ¡Öµ·¶Î§ ¿ÉÒÔ¶ÔÊý½øÐÐÕû³ý±í·¶Î§
case :
²Ù×÷;
break;
case :
²Ù×÷;
break;
default:
²Ù×÷;
break;
}
}
switch±í´ïʽµÄ·µ»ØÖµ±ØÐëÊÇint£¬byte,char,short;
case×Ó¾ä±ØÐëµÄÖµ±ØÐëÊdz£Á¿
breakÊÇÓÃÀ´Ö´ÐÐÍêÒ»¸öcase·ÖÖ§ºóÌø³öswitchÓï¾ä¿é
Ñ»·Óï¾ä
for
while
do/while
breakÓï¾äÓÃÓÚÖÕֹij¸öÓï¾ä¿éµÄÖ´ÐÐ Á¢¿ÌÖÕÖ¹
coninueÓïÑÔÓÃÓÚÌø¹ýij¸öÑ»·Óï¾ä¿éµÄÒ»´ÎÖ´ÐÐ
Á¢¿ÌÌø³ö´ËÓï¾ä¿é¶ø¼ÌÐø½øÐÐÑ»·
Ïà¹ØÎĵµ£º
ÏÂÊöÊ®Ëĸö¼¼ÇÉ£¬ÊÇÐí¶àÈËÔÚ´óÁ¿µÄÊý¾Ý¿â·ÖÎöÓëÉè¼Æʵ¼ùÖУ¬Öð²½×ܽá³öÀ´µÄ¡£¶ÔÓÚÕâЩ¾ÑéµÄÔËÓ㬶ÁÕß²»ÄÜÉú°ïÓ²Ì×£¬ËÀ¼ÇÓ²±³£¬¶øÒªÏû»¯Àí½â£¬ÊµÊÂÇóÊÇ£¬Áé»îÕÆÎÕ¡£²¢Öð²½×öµ½£ºÔÚÓ¦ÓÃÖз¢Õ¹£¬ÔÚ·¢Õ¹ÖÐÓ¦Óá£
1. Ôʼµ¥¾ÝÓëʵÌåÖ®¼äµÄ¹Øϵ
¡¡¡¡
&nbs ......
JavaÓëTSCÌõÐÎÂë´òÓ¡»ú(Ðø)
ÓÖ³öÏÖÁ½¸öÎÊÌâ:
1,sendcommandÃüÁîʹÓò¿·Ö³É¹¦£¬¿ÉÒÔÉèÖÃdirection 1,1ʹ´òÓ¡Ò³ÍêÈ«¾µÃ棬µ«ÊÇÈ´²»ÄÜʹÓÃcircle´òÓ¡³öԲȦȦ¡£
2£¬ÓÖÒ»´ÎÔÔµ½ÁËlinux-windowsÊÖÀÔÚwindows¿ª·¢Íê³Éºó£¬linux²»ÄÜʶ±ðtsclib.dll¡£ÔΣ¡
3£¬
×öjava-tsc´òÓ¡ÌõÐÎÂëÓöµ½Á˺ܶàÀ§ÄÑ£¬ÍøÉÏ×ÊÁϲ»Ò ......
import java.awt.*;
import java.awt.event.*;
import java.io.BufferedWriter;
import java.io.FileWriter;
import java.io.IOException;
import javax.swing.*;
public class ElectToo extends JFrame implements ActionListener,ItemListener
{
static ElectToo frm=new ElectToo();
static Save ......
µÚ¶þÕÂ
ÃæÏò¶ÔÏóµÄ³ÌÐòÉè¼Æ
Èí¼þ¿ª·¢µÄÎå¸ö½×¶Î
ÐèÇó·ÖÎö ³éÏó½¨Ä£
ϵͳÉè¼Æ Ä£ÐÍϸ»¯
±àÂëʵÏÖ
²âÊԽ׶Î
ϵͳά»¤
Àà(class)ºÍ¶ÔÏó(object)ÊÇÃæÏò¶ÔÏó·½·¨µÄºËÐĸÅÄî
ÀàÊǶÔÒ»ÀàÊÂÎïµÄÃèÊö ÊdzéÏóµÄ¸ÅÄîÉϵĶ¨Òå
¶ÔÏóÊÇʵ¼Ê´æÔڵĸÃÀàÊÂÎïµÄÿ¸ö¸öÌå Òò¶ø³ÉΪʵÀýinstance ......