How to use java to realize the program of memorizing words
This article is about how to use java to implement the program of memorizing words. The editor thinks it is very practical, so share it with you as a reference and follow the editor to have a look.
The details are as follows
Functional requirements: you can read a word list text file, can memorize the wrong words repeatedly, until all of them are remembered.
Package java course design; import java.io.*;import java.util.*;public class word14T {public static void main (String [] args) {/ / TODO Auto-generated method stub File file=new File ("word.txt"); / / File file1=new File ("wrong.txt"); TestWord test=new TestWord (); test.setFile (file); / / Class call setfile method test.setStopTime (5); / / set the middle pause time test.startTest ();}} class TestWord {File file Int stopTime; public void setFile (File f) {file=f;} public void setStopTime (int t) {stopTime=t;} public void startTest () {Scanner sc=null; Scanner read=new Scanner (System.in); try {sc=new Scanner (file); while (sc.hasNext ()) {String word=sc.next (); System.out.println (word); / / display the word System.out.println to be memorized ("give" + stopTime+ "time to memorize words in seconds") Thread.sleep (stopTime*1000); / / make the program dormant for a period of time to recite the word System.out.println ("\ r"); for (int item1witi