--it feels like nothing nutritious ...
PackageCom.dragon.java.tensoftware;ImportJava.io.BufferedReader;ImportJava.io.FileReader;ImportJava.io.FileWriter;Importjava.io.IOException;/** Write a program, the program can only--run--10 times, each time the runtime prompts the remaining number, 10 times after the prompt has expired*/ Public classTest { Public Static voidMain (string[] args)throwsIOException {bufferedreader br=NULL; FileWriter FW=NULL; Try{br=NewBufferedReader (NewFileReader ("c:/users/xy/desktop/file/java/java/dailycode/08-14/src/com/dragon/java/times.txt"));//define the input stream, intTimes = Integer.parseint (Br.readline ());//reads a row of data into an int value if(Times > 0) {System.out.println ("Welcome--10 hits--software, remaining use:" +Times ); FW=NewFileWriter ("c:/users/xy/desktop/file/java/java/dailycode/08-14/src/com/dragon/java/times.txt");//define the output stream,Fw.write (--times + "");//reduce the number of times by 1, write back to the file, and write the number of times back to the file as a string type}Else{System.out.println ("Software has expired"); } } Catch(IOException e) {System.out.println (e); } finally { Try{br.close (); Fw.close (); } Catch(IOException e) {System.out.println (e); } } }}
-and really can't sit on the bed playing computer ... Good pain in the waist ...
Java--> a program that can run only 10 times