Java´®¿Ú±à³Ì3
ÖÕÓÚÍê³ÉÁË´®¿ÚµÄ±àд£¬¹¦Äܼܺòµ¥£¬ÈçÏ£º
×ö³öÒ»¸ö¼òµ¥½çÃ棬Ïò´®¿Ú·¢ËÍÌض¨µÄÃüÁ´®¿ÚÉϽÓÓй©²âÊÔÓõĴ®¿ÚÉ豸£©£¬½ÓÊÕÉ豸·µ»ØµÄÊý¾ÝÔÚ½çÃæÉÏÏÔʾ£º
import gnu.io.CommPortIdentifier;
import gnu.io.PortInUseException;
import gnu.io.SerialPort;
import gnu.io.SerialPortEvent;
import gnu.io.SerialPortEventListener;
import gnu.io.UnsupportedCommOperationException;
import java.awt.Button;
import java.awt.Frame;
import java.awt.Panel;
import java.awt.TextArea;
import java.awt.TextField;
import java.awt.event.ActionEvent;
import java.awt.event.ActionListener;
import java.awt.event.WindowAdapter;
import java.awt.event.WindowEvent;
import java.io.IOException;
import java.io.InputStream;
import java.io.OutputStream;
import java.util.Enumeration;
import java.util.TooManyListenersException;
class S_Frame extends Frame implements ActionListener,SerialPortEventListener {
//¼ì²âϵͳÖпÉÓõÄͨѶ¶Ë¿ÚÀà
static CommPortIdentifier portId;
//Enumeration Ϊö¾ÙÐÍÀà,ÔÚutilÖÐ
static Enumeration portList;
//ÊäÈëÊä³öÁ÷
InputStream inputStream;
OutputStream outputStream;
//RS-232µÄ´®ÐпÚ
SerialPort serialPort;
Thread readThread;
String str = "";
//½çÃæ
Panel p = new Panel();
TextArea in_message = new TextArea("´ò¿ªCOM1,²¨ÌØÂÊ9600,Êý¾Ýλ8,ֹͣλ1.");
TextArea out_message = new TextArea("X010600Y");
Button btnOpen = new Button("´ò¿ª´®¿Ú, ·¢ËÍÊý¾Ý");
Button btnClose = new Button("¹Ø±Õ´®¿Ú, Í£Ö¹·¢ËÍÊý¾Ý");
byte data[] = new byte[10240];
Ïà¹ØÎĵµ£º
ListµÄÓ÷¨
List°üÀ¨List½Ó¿ÚÒÔ¼°List½Ó¿ÚµÄËùÓÐʵÏÖÀà¡£ÒòΪList½Ó¿ÚʵÏÖÁËCollection½Ó¿Ú£¬ËùÒÔList½Ó¿ÚÓµÓÐCollection½Ó¿ÚÌṩµÄËùÓг£Ó÷½·¨£¬ÓÖÒòΪListÊÇÁбíÀàÐÍ£¬ËùÒÔList½Ó¿Ú»¹ÌṩÁËһЩÊʺÏÓÚ×ÔÉíµÄ³£Ó÷½·¨£¬Èç±í1Ëùʾ¡£
±í1 List½Ó¿Ú¶¨ÒåµÄ³£Ó÷½·¨¼°¹¦ÄÜ
´Ó±í1¿ÉÒÔ¿´³ö£¬List½Ó¿ÚÌṩµÄÊʺÏÓÚ×ÔÉíµÄ ......
package arrays.myArray;
public class MyLinkedList {
private int size = 0;
private Node1 head = null;
// Ìí¼Ó
public void add(Object obj) {
add(size, obj);
}
// ÐÞ¸Ä
public void add(int index, Object obj) {
if (null == head) ......
package game;
public class HanTa {
public static int i = 0;
public static void main(String[] args){
calc('A', 'B', 'C', 2);
System.out.println("×îÉÙÐèÒª"+i+"²½¡£");
}
//ººÂÞËþÓÎÏ·¼ÆËã
public static void calc(char src, char ilde, c ......
JavaÊý¾ÝÀàÐÍÓëת»»
JavaÊý¾ÝÀàÐÍ·ÖΪÈý´óÀà
²¼¶ûÐÍ£¬×Ö·ûÐÍ(char)£¬ÊýÖµÐÍ(ÕûÊý,¸¡µãÐÍ)
ÕûÊýÀàÐÍÓУºbyte(8bits)¡¢short(16bits)¡¢int(32bits)¡¢long(64bits)¡¢
¸¡µãÀàÐÍÓУºµ¥¾«¶È£¨32bits float£©¡¢Ë«¾«¶È£¨64bits double£©
booleanÀàÐͱäÁ¿µÄÈ¡ÖµÓУºture¡¢false
charÊý¾ÝÀàÐÍÓУºunicode×Ö·û,16λ
Êý¾ÝÀàÐÍת» ......
ÕâƪÎÄÕÂÌÖÂۺͲûÃ÷ÁËÌṩ JavaTM I/O ÐÔÄܵĶàÖÖ¼¼Êõ¡£´ó¶à¼¼ÊõΧÈƵ÷Õû´ÅÅÌÎļþ I/O,µ«ÊÇÓÐЩÄÚÈÝҲͬÑùÊʺÏÍøÂç I/O ºÍ´°¿ÚÊä³ö¡£µÚÒ»²¿·Ö¼¼ÊõÌÖÂ۵ײãµÄI/OÎÊÌ⣬ȻºóÌÖÂÛÖîÈçѹËõ£¬¸ñʽ»¯ºÍ´®Ðл¯µÈ¸ß¼¶I/OÎÊÌ⡣Ȼ¶øÕâ¸öÌÖÂÛûÓаüº¬Ó¦ÓÃÉè¼ÆÎÊÌ⣬ÀýÈçËÑË÷Ëã·¨ºÍÊý¾Ý½á¹¹£¬Ò²Ã»ÓÐÌÖÂÛϵͳ¼¶µÄÎÊÌ⣬ÀýÈçÎļþ¸ßËÙ»º³å ......