Skip to main content
The 2025 Developer Survey results are in. Explore insights into technology and tools, careers, community and more. View results.

All Questions

Tagged with
Filter by
Sorted by
Tagged with
1 vote
1 answer
1k views

Read and sort 100 numbers from a text file

The program itself reads 100 values from a text file named input.txt. Then sorts those values in ascending order and writes the values to a new file called ...
HunterShaw's user avatar
4 votes
2 answers
239 views

Reader for graph-file with ugly return and questionable use of streams

I wrote a class that contains a static method that reads in files from NetworkRepository and converts them into a list of integer-arrays, each representing an edge. The file format from ...
Moritz Groß's user avatar
0 votes
3 answers
103 views

Processing an InputStream and writing to an OuputStream, and ensuring that both streams get closed

Is it a bad thing to do multiple file closings in single finally block? Relevant excerpt: ...
industryworker3595112's user avatar
5 votes
1 answer
285 views

Transferring data from one file stream to another

I am currently reading Clean Code and for fun and profit, I intended to refactor some of the Java Tutorials and since I wanted to improve my Exception handling, the Byte Stream one with its lots of ...
AdHominem's user avatar
  • 728
4 votes
2 answers
264 views

Property file loader

I have the following code: ...
Eugene Ustimenko's user avatar
5 votes
2 answers
16k views

IO and Scanner exception handling

I have created a sample file reading program as an exercise while learning how to implement good exception handling. I want to ask: is this a good approach or is there some other solution that I am ...
Deepak Singh's user avatar
6 votes
5 answers
9k views

Java Stream Exception Handling

I find this piece of Java code really ugly and cumbersome. How can I refactor it to be more clean and easier to read? ...
KirdApe's user avatar
  • 95