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

Java RandomAccessFile дÈëtxtÎļþ - Java / Java SE

ÓÃRandomAccessFileдÈëTXTÎļþ²é¿´Ê±ÊÇÂÒÂ룬ÇëÎÊÓÐʲô·½·¨¿ÉÒÔд³É¿É¶ÁµÄÎļþ£¬²»ÊÇÓÃÆäËûµÄÎļþ²Ù×÷£¬¾ÍÊÇÖ»ÓÃRandomAccessFileµÄ·½·¨ÊÇ·ñ¿ÉÒÔʵÏÖ£¿
Java code:
import java.io.*;
public class RandomAccessFileDemo
{
public static void main(String[] args) throws IOException
{
RandomAccessFile raf=new RandomAccessFile("random.txt","rw");
raf.writeBoolean(true);
raf.writeInt(2008);
raf.writeChar('Äê');
raf.writeDouble(08.08);
raf.writeUTF("Å·ÁÖÆ¥¿ËÔ˶¯»á");
raf.seek(1);
System.out.println(raf.readInt());
System.out.println(raf.readChar());
System.out.println(raf.readDouble());
System.out.println(raf.readUTF());
raf.seek(0);
System.out.println(raf.readBoolean());
raf.close();
}
}

ÕâÖÖÂÒÂëÒ»°ã¶¼ÊÇÒòΪ×Ö·û´®µÄ±àÂë»òÕß×Ö·û´®×ª»»×Ö½ÚµÄʱºò±àÂ벻ͬ¶øÒýÆðµÄ¡£ËùÒÔÊ×ÏÈ×îºÃ¶ÔҪдÈëÎļþµÄ×Ö·û´®»òÕßÁ÷¶¼½øÐÐÒ»±é±àÂëÉ趨¡£

1¡¢String.getBytes£¨£©½«»á°´ÕÕµ±Ç°ÏµÍ³Ä¬ÈϵÄencoding·½Ê½»ñµÃ×Ö·û´®µÄ Bytes£¬RandomAccessFile.write(byte[])½«Õâ¸öbyteÊý×éÕýȷдÈë¡£ÓÉÓÚдÈëµÄʵ¼Ê¾ÍÊÇWindowsƽ̨µÄ nativecode±àÂ룬ËùÒÔÎļþ»¹Äܹ»±»ÕýÈ·µÄÔĶÁ¡£
2¡¢RandomAccessFile.writeBytes(String)½«×Ö·û´®µÄ¸÷¸ö×Ö·û£¨µ±È»ÊÇÓÃunicode±àÂëµÄ£©µÄ¸ß8λȥµô£¬Ð´ÈëÎļþ¡£
3¡¢RandomAccessFile.writeChars(String)½«×Ö·û´®µÄ¸÷¸ö


Ïà¹ØÎÊ´ð£º

jspÒ³Ãæ»ñÈ¡sessionµÄÎÊÌâ - Java / Java EE

ÎÒÔÚjspÒ³Ãæ´æÉÏÒ»¸ösession,±¾Ò³Ã滹¿ÉÒÔÈ¡³öÖµÀ´.
µ«ÊÇһˢÐÂ,»òÕß´ò¿ªÐµÄÒ³Ãæ¾ÍÈ¡²»³öÖµÀ´ÁË.
Ææ¹ÖµÄÊÇ,ÎÒ²âÊÔÁíÒ»¸ö³ÌÐòʱºò
ÔÚjspÒ³Ãæ´æÉÏÒ»¸ösession,±¾Ò³Ãæ¿ÉÒÔÈ¡³öÖµÀ´,ˢлò´ò¿ªÐÂÒ³ÃæÖµÄÜÈ¡³öÀ´ÁË.
......

¹ØÓÚjspÂÛ̳ - Java / Web ¿ª·¢

ÎÒÏÖÔÚÏëÓÃsshÕûºÏÀ´×öÒ»¸öÂÛ̳£¬µ«Êý¾Ý¿â·½Ãæ²»ÐУ¬ÎÒÖ÷Òª²»»áÉæ¼°Êý¾Ý¿â£¬²»ÖªµÀ·¢Ìû±í£¬ºÍ»ØÌû±íÒªÈçºÎÉè¼ÆºÍÇø·Ö¡£²»ÖªµÀË­ÓÐÒ»¸ö¼òµ¥µÄ˼·£¬À´Éè¼ÆÕâЩ±í¡£Ð»Ð»ÁË¡£
·¢ÌûºÍ»ØÌûÓÃͬһÕÅ±í ¡£·¢Ìû id user ......

Unable to compile class for JSP - Java / Web ¿ª·¢

<%@page language="java" contentType="text/html;charset=gb2312" import="java.sql.*"%>
<jsp:useBean id="db" class="wang.connectDB"/>
< ......

ÕÐƸJava web¿ª·¢ÈËÔ±

²àÖØÓÚ»¥ÁªÍø¿ª·¢

JAVA¿ª·¢¹¤³Ìʦ
ְλÃèÊö£º
1¡¢°´USECASE½øÐÐÒµÎñÐèÇó·ÖÎöºÍÈí¼þ¸ÅÒªÉè¼Æ£»
2¡¢½øÐÐÈí¼þÏêϸÉè¼ÆºÍ±àÂëʵÏÖ£¬È·±£ÐÔÄÜ¡¢ÖÊÁ¿ºÍ°²È«£»
3¡¢Î¬»¤ºÍÉý¼¶ÏÖÓÐÈí¼þ²úÆ·£¬¿ìËÙ¶¨Î»² ......

Ìì½ò ÕÐƸ¼æÖ°£¨java struts2)

ÎÒÃÇÓÐÏîÄ¿Ïë×齨һ¸ö¿ª·¢ÍŶӣ¬
Ö÷ÒªÓà tomcat,java,struts2,ÎÒÃǵĺËÐijÉÔ±¶¼ÊǾ­Ñé·Ç³£·á¸»µÄϵͳÉè¼Æʦ£¬
Èç¹ûÄúÔÚÌì½ò£¬Í¬Ê±¶Ôjava±È½Ï¸ÐÐËȤ£¬
¿ÉÒÔ¼ÓÈëÎÒÃÇ¡£
Ï£ÍûÒªÇó
  1¡£°®ºÃ±à³Ì
......
© 2009 ej38.com All Rights Reserved. ¹ØÓÚE½¡ÍøÁªÏµÎÒÃÇ | Õ¾µãµØͼ | ¸ÓICP±¸09004571ºÅ