feat: complete all files
This commit is contained in:
@@ -7,18 +7,16 @@ import java.util.List;
|
||||
|
||||
public class ReadFileExample02 {
|
||||
static void main() {
|
||||
try
|
||||
{
|
||||
Path path = Path.of("example.txt");
|
||||
Path path = Path.of("quotes.txt");
|
||||
try {
|
||||
List<String> lines = Files.readAllLines(path);
|
||||
for(String line: lines)
|
||||
|
||||
for(String line : lines)
|
||||
{
|
||||
System.out.println(line);
|
||||
}
|
||||
}
|
||||
catch (IOException e)
|
||||
{
|
||||
System.err.println("Something went wrong");
|
||||
} catch (IOException e) {
|
||||
throw new RuntimeException(e);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user