Network Security Internet Technology Development Database Servers Mobile Phone Android Software Apple Software Computer Software News IT Information

In addition to Weibo, there is also WeChat

Please pay attention

WeChat public account

Shulou

How to use java to realize the program of memorizing words

2025-01-18 Update From: SLTechnology News&Howtos shulou NAV: SLTechnology News&Howtos > Development >

Share

Shulou(Shulou.com)06/03 Report--

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

Welcome to subscribe "Shulou Technology Information " to get latest news, interesting things and hot topics in the IT industry, and controls the hottest and latest Internet news, technology news and IT industry trends.

Views: 0

*The comments in the above article only represent the author's personal views and do not represent the views and positions of this website. If you have more insights, please feel free to contribute and share.

Share To

Development

Wechat

© 2024 shulou.com SLNews company. All rights reserved.

12
Report