FazBrowse GitHub Viewer
|
Trending
|
URL:
|
Home
Tools:
[Download Repo ZIP]
[View Raw Code]
[Original HTTPS Page]
Lessons4JavaSE/src/unit06/TestFileClass.java at master · AlohaWorld/Lessons4JavaSE · GitHub
AlohaWorld
/
Lessons4JavaSE
Public
Notifications
You must be signed in to change notification settings
Fork
4
Star
19
Code
Issues
1
Pull requests
0
Actions
Projects
Security and quality
0
Insights
Additional navigation options
Code
Issues
Pull requests
Actions
Projects
Security and quality
Insights
Expand file tree
Breadcrumbs
Lessons4JavaSE
/
src
/
unit06
/
TestFileClass.java
Copy path
More file actions
More file actions
Latest commit
History
History
History
17 lines (16 loc) · 813 Bytes
Breadcrumbs
Lessons4JavaSE
/
src
/
unit06
/
TestFileClass.java
Copy path
File metadata and controls
17 lines (16 loc) · 813 Bytes
Raw
Copy raw file
Download raw file
Open symbols panel
Edit and raw actions
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
package
unit06
;
public
class
TestFileClass
{
public
static
void
main
(
String
[]
args
) {
java
.
io
.
File
file
=
new
java
.
io
.
File
(
"image/us.gif"
);
System
.
out
.
println
(
"Does it exist? "
+
file
.
exists
());
System
.
out
.
println
(
"The file has "
+
file
.
length
() +
" bytes"
);
System
.
out
.
println
(
"Can it be read? "
+
file
.
canRead
());
System
.
out
.
println
(
"Can it be written? "
+
file
.
canWrite
());
System
.
out
.
println
(
"Is it a directory? "
+
file
.
isDirectory
());
System
.
out
.
println
(
"Is it a file? "
+
file
.
isFile
());
System
.
out
.
println
(
"Is it absolute? "
+
file
.
isAbsolute
());
System
.
out
.
println
(
"Is it hidden? "
+
file
.
isHidden
());
System
.
out
.
println
(
"Absolute path is "
+
file
.
getAbsolutePath
());
System
.
out
.
println
(
"Last modified on "
+
new
java
.
util
.
Date
(
file
.
lastModified
()));
}
}
Back
|
FazBrowse Home
|
New Git URL