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

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];


Ïà¹ØÎĵµ£º

java£ºdoubleÀàÐͽØÈ¡Á©Î»Ð¡Êý£¬²»È¡Éᣬ

public class Split{
 public static void main(String[] args){
       double pai = 3.14159;
        findTwo(pai);
  public static void findTwo(double value){
    System.out.println(new DecimalFormat("0.##"). ......

java£ºArrayListÑ­»·±éÀúµÄÁ©ÖÖ·½·¨Ê¹ÓÃ

package collection;
import java.util.*;
public class NewArrayList {
 public static void main(String[] args) {
  List<Student> students = new ArrayList<Student>();
  for (int i = 0; i < 6; i++) {
   students.add(new Student("Happy"+i,"male" ......

java£ºµÝ¹é£º10µÄ½×³Ë

package game;
public class JieCeng {
 public static void main(String[] args){
  System.out.println(fun(10));
 }
 
 public static int fun(int n){
  if(1==n)
   return 1;
  System.out.println( n * fun(n-1));
  return ......

JAVAÊý¾ÝÀàÐÍÓëת»»

JavaÊý¾ÝÀàÐÍÓëת»»
JavaÊý¾ÝÀàÐÍ·ÖΪÈý´óÀà
²¼¶ûÐÍ£¬×Ö·ûÐÍ(char)£¬ÊýÖµÐÍ(ÕûÊý,¸¡µãÐÍ)
ÕûÊýÀàÐÍÓУºbyte(8bits)¡¢short(16bits)¡¢int(32bits)¡¢long(64bits)¡¢
¸¡µãÀàÐÍÓУºµ¥¾«¶È£¨32bits float£©¡¢Ë«¾«¶È£¨64bits double£©
booleanÀàÐͱäÁ¿µÄȡֵÓУºture¡¢false
charÊý¾ÝÀàÐÍÓУºunicode×Ö·û,16λ
Êý¾ÝÀàÐÍת» ......

Java SEѧϰ_0xf0_С½â_ÓÃÒÆÎ»×ª»»Îª16½øÖÆ

Java   ÀïÃæ0x¿ªÍ·µÄÊýֵΪ16½øÖÆµÄ   
    
  0xf0   =   15*16   =   240;  
//¼òµ¥Ë㣬ºÃ±ÈÊ®½øÖÆ60 = 6 *10 = 60;
  int   i   =   0xf0;   
  ¾ÍÏ൱ÓÚ   
  int   i   = ......
© 2009 ej38.com All Rights Reserved. ¹ØÓÚE½¡ÍøÁªÏµÎÒÃÇ | Õ¾µãµØÍ¼ | ¸ÓICP±¸09004571ºÅ