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();
}
}
Ïà¹ØÎĵµ£º
WindowsÏÂJAVA»·¾³±äÁ¿µÄÉèÖÃ
WindowsÏÂJAVAÓõ½µÄ»·¾³±äÁ¿Ö÷ÒªÓÐ3¸ö£¬JAVA_HOME¡¢CLASSPATH¡¢PATH¡£ÏÂÃæÖð¸ö·ÖÎö¡£
JAVA_HOME Ö¸ÏòµÄÊÇJDKµÄ°²×°Â·¾¶£¬Èçx:\JDK_1.4.2£¬ÔÚÕâ·¾¶ÏÂÄãÓ¦¸ÃÄܹ»ÕÒµ½bin¡¢libµÈĿ¼¡£ÖµµÃÒ»ÌáµÄÊÇ£¬JDK µÄ°²×°Â·¾¶¿ÉÒÔÑ¡ÔñÈÎÒâ´ÅÅÌĿ¼£¬²»¹ý½¨ÒéÄã·ÅµÄĿ¼²ã´ ......
ÊʺϳõѧÕßÀí½â
1£¬testflex.mxml
<?xml version="1.0" encoding="utf-8"?>
<s:Application xmlns:fx="http://ns.adobe.com/mxml/2009"
xmlns:s="library://ns.adobe.com/flex/spark"
xmlns:mx="library://ns.adobe.com/flex/mx"
creationComplete="init()"
minWidth="955 ......
ÔÌâÈçÏ£ºÓÃ1¡¢2¡¢2¡¢3¡¢4¡¢5ÕâÁù¸öÊý×Ö£¬ÓÃjavaдһ¸ö³ÌÐò£¬´òÓ¡³öËùÓв»Í¬µÄÅÅÁУ¬È磺512234¡¢412345µÈ£¬ÒªÇó£º"4"²»ÄÜÔÚµÚÈý룬"3"Óë"5"²»ÄÜÏàÁ¬¡£
½âÌâ˼·£º
ºÜÃ÷ÏÔ£¬ÕâÊÇÒ»¸öµÝ¹éËã·¨¡£ÎÒÃÇ¿ÉÒÔÅÅÁн«Õâ6¸öÊý°´´ÓСµ½´óµÄ˳ÐòÅÅһϣ¬Èç¹ûÊÇ1,2,3,4,5,6£¬ÄÇô»áÓÐ1 ......