Tuesday, November 28, 2017

Read a text file in only one line of Java code

Since Java 7, you can do this with this wonderfull line :

new String(Files.readAllBytes(Paths.get(this.getClass().getResource("/file.txt").toURI())))

That makes Java powerfull and I love that.

2 comments:

raj kumar said...

Looking very good blog. I am so thankful to you and expecting more info on Core Java and please do keep sharing on...
Thank you so much

Shailendra said...

Wow, very nice blog. I like it. thanks for sharing helpful post.
JAVA Training in Gurgaon | JAVA Training Institute in Gurgaon

How to remove "Quick Access" in Explorer on Microsoft Windows 10

Just make Control + R and execute regedit. HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows\CurrentVersion\Explorer right side new DWORD (32...