Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
2
20231104-KursPodstawowyALX
Overview
Overview
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
Patryk Czarnik
20231104-KursPodstawowyALX
Commits
bba816d5
Commit
bba816d5
authored
Dec 03, 2023
by
Patryk Czarnik
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
readAllLines
parent
1296ca64
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
22 additions
and
0 deletions
+22
-0
Odczyt4_ReadAllLines.java
src/main/java/p11_pliki/Odczyt4_ReadAllLines.java
+22
-0
No files found.
src/main/java/p11_pliki/Odczyt4_ReadAllLines.java
0 → 100644
View file @
bba816d5
package
p11_pliki
;
import
java.io.IOException
;
import
java.nio.file.Files
;
import
java.nio.file.Paths
;
import
java.util.List
;
public
class
Odczyt4_ReadAllLines
{
// Od Javy 7 operacja Files.readAllLines - wczytuje wszystkie linie do pamięci w formie listy.
public
static
void
main
(
String
[]
args
)
{
try
{
List
<
String
>
lines
=
Files
.
readAllLines
(
Paths
.
get
(
"pliki/pan_tadeusz.txt"
));
System
.
out
.
println
(
"Liczba linii: "
+
lines
.
size
());
for
(
String
line
:
lines
)
{
System
.
out
.
println
(
line
);
}
}
catch
(
IOException
e
)
{
e
.
printStackTrace
();
}
}
}
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment