1
1

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?

More than 5 years have passed since last update.

Javaのプログラムに機能を追加したいです。

Posted at

Javaのプログラムに機能を追加したいです。
ヒントやアドバイスを頂けませんか!
import java.io.File;
import java.io.FileReader;
import java.io.FileNotFoundException;
import java.io.IOException;
import java.io.BufferedReader;
import java.io.BufferedWriter;
import java.util.Scanner;

class {
public static void main(String args[]){

String fileNeme=args[0];

try{
String str;
File file=new File(fileNeme);

if(file.exists()){
System.out.println("ファイルは存在します。");
}else{
System.out.println("ファイルは存在しません。");
}

try{
while(true){

BufferedReader in = new BufferedReader(new FileReader(fileNeme));

while((str = in.readLine())!=null){
System.out.println(str);
}

try{
Thread.sleep(60000);
}catch(InterruptedException e){
;
}

in.close();
}
}catch(FileNotFoundException e){
System.out.println("ファイルは存在しません。");
}
}catch(Exception e){
;
}
}
}
表示内容の更新タイミングを1分固定ではなく可変にする機能を追加したいです。
質問に対しての沢山の的確な回答をお待ちしております。宜しくお願いします

1
1
0

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
  3. You can use dark theme
What you can do with signing up
1
1

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?