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

Java°´ÐжÁÈ¡Îı¾Îļþ

import java.io.*;
public class IoTest
{
public static void main(String[] args)
{
String s;
s=calculate();
System.out.println(s);
}
static String calculate()
{
StringBuffer sb=new StringBuffer("");
try{
FileReader reader = new FileReader("words.txt");
BufferedReader br = new BufferedReader(reader);
String s = null;
while((s = br.readLine()) != null) {
sb.append(s+'\n');
}
br.close();
reader.close();
}catch(Exception e){
e.printStackTrace();
}
return sb.toString();
}
}


Ïà¹ØÎĵµ£º

[Java] JRebel + Maven + Jetty ÈȲ¿Êð

Ôç¾ÍÑá·³ÁË Java ¿ª·¢²»¶ÏµÄÈÝÆ÷×Ô¶¯ÖØмÓÔØÂþ³¤µÄ¹ý³Ì£¬Ñо¿ maven + jetty ÈȲ¿Êð·½°¸µÄ¹ý³ÌÖÐżȻ·¢ÏÖÒ»Ñù²»´íµÄ¶«¶«£¬ÊÔÓÃÁËһϹûÈ»ºÜˬ£¬·¢ÉÏÀ´¸ø´ó¼Ò¹²Ïí£¬´ËÎïÃûΪ JRebel (javarebel)£¬Ä¿Ç°Ö§³Ö´ó²¿·ÖÖ÷Á÷µÄ Java ÈÝÆ÷£¬ÅäÖÃÒ²Ï൱¼òµ¥£¬ÒÔÏÂÊÇÓë maven + jetty »·¾³ÕûºÏµÄ²½ÖèÓëÒªµã£º
Ê×ÏÈ£¬ÏÂÔØ JRebel °ü£¬Ä ......

javaº¯Êý²é¿´Îļþ´óС

FileInputStream fis=null;
try 
{
  fis=new FileInputStream("file url")
}
catch(Exception e){e.printStackTrace()}
System.out.println("File has "+ fis.available() + " bytes"); ......

Êý¾Ý¿âResultSetÏê½â£¨java£©

ÕâƪÎÄÕ²¢Ã»Óиø³öÈçºÎʹÓÃResultSetµÄ¾ßÌåÀý×Ó£¬Ö»ÊÇ´ÓResultSetµÄ¹¦ÄÜÐÔÉϽøÐÐÁËÏêϸµÄ½²Êö¡£Ï£ÍûÕâƪÎÄÕ¶Դó¼ÒÀí½âResultSetÄܹ»ÓÐËù°ïÖú¡£ÏÂÃæ¾ÍÊÇÕâƪÎÄÕµľßÌåÄÚÈÝ¡£
         ½á¹û¼¯(ResultSet)ÊÇÊý¾ÝÖвéѯ½á¹û·µ»ØµÄÒ»ÖÖ¶ÔÏ󣬿ÉÒÔ˵½á¹û¼¯ÊÇÒ»¸ö´æ´¢²éѯ½á¹ûµÄ¶ÔÏó£ ......

java ÈçºÎÅäÖû·¾³±äÁ¿

ÅäÖÃjava »·¾³±äÁ¿ºÜ¼òµ¥ £º
Ê×ÏÈ:
1¡¢Ë«»÷“ÎҵĵçÄÔ”
2¡¢Ë«»÷“¿ØÖÆÃæ°å”
3¡¢Ë«»÷“ϵͳ”
4¡¢µã»÷“¸ß¼¶”Ñ¡Ï£¬
5¡¢µã»÷“»·¾³±äÁ¿”°´Å¥
Æä´Î:
1¡¢±äÁ¿Ãû: path
±äÁ¿Öµ: C:\jdk1.6.0\bin;
2¡¢±äÁ¿Ãû: classpath
±äÁ¿Öµ: .;%JAVA_HOME%\lib\ ......
© 2009 ej38.com All Rights Reserved. ¹ØÓÚE½¡ÍøÁªÏµÎÒÃÇ | Õ¾µãµØͼ | ¸ÓICP±¸09004571ºÅ