Java File class

Java File class

Bro Code

3 года назад

81,478 Просмотров

Ссылки и html тэги не поддерживаются


Комментарии:

@Bromosexxual
@Bromosexxual - 14.12.2023 21:04

Thank you!

Ответить
@user-ob2iv6cb9m
@user-ob2iv6cb9m - 09.11.2023 21:07

Like, subscribe. Thanks!

Ответить
@vijaysinhkhot2871
@vijaysinhkhot2871 - 12.10.2023 18:30

Thanks a lot!

Ответить
@mehedis_creation
@mehedis_creation - 21.08.2023 06:02

sheiii bro

Ответить
@rahelina7176
@rahelina7176 - 13.08.2023 08:58

Thanks! Cramming and my prof didn't cover this topic :/

Ответить
@TheRickyfranco13
@TheRickyfranco13 - 20.06.2023 05:53

Awesome video, I love the way you explain new concepts

Ответить
@ajdndbdjbdj
@ajdndbdjbdj - 24.05.2023 22:06

Hello , i have a question please , i did all the instructions but it shows no file for some reason , why is that ?

Edit: its ok comments already answered that , keep the great work man

Ответить
@PoorwayTraning
@PoorwayTraning - 18.05.2023 14:59

thanks

Ответить
@felion5574
@felion5574 - 06.05.2023 13:34

thank you, you are the best : >

Ответить
@zstar8397
@zstar8397 - 27.04.2023 22:34

Yo just wanna say that GOD loved the world so much he sent his only begotten
son Jesus to die a brutal death for us so that we can have eternal life
and we can all accept this amazing gift this by simply believing in him (Jesus) asking for the forgiveness of your sins
and forming a relationship with heavenly father.

Ответить
@maleeshanethmi5156
@maleeshanethmi5156 - 18.04.2023 06:12

Short N Sweet

Ответить
@longkesh1971
@longkesh1971 - 15.04.2023 03:30

Thanks bro.

Ответить
@adnanhabib3059
@adnanhabib3059 - 31.03.2023 16:13

you are realy helpful bro. :)

Ответить
@akkiyethi
@akkiyethi - 27.03.2023 08:03

Keep your text file outside your src folder incase if file.exists() always returns false...

Ответить
@grozageorge2887
@grozageorge2887 - 26.03.2023 13:03

😀

Ответить
@asgoritolinasgoritolino7708
@asgoritolinasgoritolino7708 - 18.03.2023 21:04

What a useful programming video, and by a person who actually talks english!
Amazing.

Ответить
@user-zq6yx7of5f
@user-zq6yx7of5f - 17.03.2023 04:28

Thank you very much

Ответить
@tradoson6493
@tradoson6493 - 28.02.2023 17:09

beautiful work my lord

Ответить
@srijaya7246
@srijaya7246 - 14.02.2023 07:38

😇❤

Ответить
@joyceasante8292
@joyceasante8292 - 22.01.2023 21:22

import java.io.File;

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

File file = new File("song_lyrics.txt");

if(file.exists()){
System.out.println("That file exists! :O!");
System.out.println(file.getPath());
System.out.println(file.getAbsolutePath());
System.out.println(file.isFile());
file.delete();
}
else{
System.out.println("File does not exist");
}
}
}

Ответить
@oscarjosefsson9300
@oscarjosefsson9300 - 22.01.2023 16:01

So, as some people have already pointed out.

Sometimes you need to enter the complete path for the file.

You can see what that path is by right-clicking the file in the project tree and choose "Properties".
Then copy all of that and use it instead of just the file name.

Ответить
@emaanrana25
@emaanrana25 - 15.01.2023 12:25

If you're having trouble with the file path, run the following line of code to figure out what the current working directory is:

System.out.println("Working Directory = " + System.getProperty("user.dir"));

Then write the file path relative to the current working directory.

VSCode seems to set the current working directory to be whatever the Folder selected for the Workspace to be. The Workspace is the GUI (graphical user interface) with all the files/file directory.

Ответить
@dnago916
@dnago916 - 22.11.2022 21:50

.

Ответить
@vinny4161
@vinny4161 - 06.11.2022 11:35

Hey you! I'm talking to youif you learn something new then you can help me, help you in 3 easy steps smash the like button ,drop a comment down below and subscribe I'd you'd like to become a fellow bro

Ответить
@youssefnajim9740
@youssefnajim9740 - 04.11.2022 22:26

come on bro we want spring framework and spring boot

Ответить
@soumelee5661
@soumelee5661 - 19.10.2022 10:50

thanks very nice vid & explanation

Ответить
@cool_huip_
@cool_huip_ - 14.10.2022 12:46

Add a public comment...

Ответить
@kenaz3066
@kenaz3066 - 14.10.2022 03:05

I do have a file but it won’t full the array

Ответить
@wallstreetbets7741
@wallstreetbets7741 - 18.09.2022 08:33

Watch now

Ответить
@pushankarmakar1783
@pushankarmakar1783 - 16.09.2022 16:10

thakyou so much for the videos

Ответить
@mostwanted9817
@mostwanted9817 - 12.09.2022 08:44

"Please excuse the mess".
Me:*starts breathing heavily knowing I have over 50+ files on my desktop*

Ответить
@alexyakoveno4682
@alexyakoveno4682 - 10.09.2022 11:04

Ответить
@Simis999
@Simis999 - 09.09.2022 23:25

Don't we have to close the file afterwards?

Ответить
@danielmilewski7659
@danielmilewski7659 - 05.09.2022 10:09

thanks! really well explained!

Ответить
@imie5762
@imie5762 - 22.08.2022 18:00

I don't quite understand the file.delete part. Shouldn't the program every time you start it create a file (File file = new File("poem.txt");) , so eventually only the first condition of if statement (file.exists()) would be fulfilled. I know the file gets deleted by the end, but with another start of the program it is created again. So like, why every other start of the program ignores the File file = new File(); line.

Ответить
@baracuxxo2497
@baracuxxo2497 - 13.08.2022 21:41

nice video

Ответить
@maxwong1768
@maxwong1768 - 27.07.2022 16:58

If I use the relative filename , the java can't find that txt file .

There are 3 solutions

1) type "src\\message.txt" or "src/message.txt" .

2) Change the eclipse working directory to the absolute pathname of the folder (src) that contains your packages and txt file .

By doing that , you can click section in top bar [Run] -> [Run Configurations] -> [Arguments] -> [Working directory] -> change from [Default] radio button to [Other] , enter your absolute pathname after [Other] -> [Apply] -> [Run]

3) type the absolute pathname .

Ответить
@ABC-zv1sd
@ABC-zv1sd - 20.07.2022 12:49

Hello,

I am developing android java filemanager app.. I used checkbox to check 1/file.mp4
2/folder(files+sub folders)
.

How can i add copy paste feature for checked 1, 2 file folder fully at same time ?like -google filemanager app..

Advance Thanks

Ответить
@MrLoser-ks2xn
@MrLoser-ks2xn - 08.06.2022 19:33

Thanks

Ответить
@zari_723
@zari_723 - 06.06.2022 14:16

(●'◡'●)

Ответить
@hesham4744
@hesham4744 - 05.06.2022 13:50

اقسم بالله عظمة !!

Ответить
@AdrianTregoning
@AdrianTregoning - 20.04.2022 10:33

Nuclear launch codes 🤣 I had a good laugh now.

Ответить
@bharathpavurala7817
@bharathpavurala7817 - 12.04.2022 11:00

You are just awesome 😎

Ответить
@Isy_The_Dragon_Artist
@Isy_The_Dragon_Artist - 28.03.2022 18:39

Thank you for all your work on these videos

Ответить
@ibrahimylmaz8378
@ibrahimylmaz8378 - 28.03.2022 02:42

thanks bro

Ответить
@motasemshtewi5153
@motasemshtewi5153 - 24.03.2022 13:16

you are one of the best to the best

Ответить
@harshnitnaware9143
@harshnitnaware9143 - 15.03.2022 20:40

hey bro can you paste the code in the comment

Ответить
@cirrusyk
@cirrusyk - 01.02.2022 15:44

nuclear launch codes... 💀💀💀💀💀💀

Ответить
@eduardofabris8523
@eduardofabris8523 - 17.01.2022 18:21

love the easter eggs

Ответить