feat: complete all files
This commit is contained in:
@@ -6,22 +6,17 @@ import java.util.Scanner;
|
||||
|
||||
public class ReadFileExample01 {
|
||||
static void main() {
|
||||
try
|
||||
{
|
||||
File file = new File("example.txt");
|
||||
File file = new File("quotes.txt");
|
||||
try {
|
||||
Scanner reader = new Scanner(file);
|
||||
while(reader.hasNextLine())
|
||||
|
||||
while(reader.hasNext())
|
||||
{
|
||||
String line = reader.nextLine();
|
||||
System.out.println(line);
|
||||
}
|
||||
reader.close();
|
||||
}
|
||||
catch (FileNotFoundException e)
|
||||
{
|
||||
throw new RuntimeException(e);
|
||||
}
|
||||
|
||||
} catch (FileNotFoundException e) {
|
||||
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user