Let's build a file from various pieces. Read file names from the console. Each file has a name:
.partN. For example, Lion.avi.part1, Lion.avi.part2, ..., Lion.avi.part37.
The file names are supplied in random order. The word "end" is used to stop reading in file names.
In the folder where
Building a file
You must be signed in to leave a comment
20 February, 13:21
Why Comparator if it perfectly works with noargs TreeSet constructor?)
27 January 2022, 14:03
Couldn't get this task passed until I put a check on whether the file contains the word ".part" in it. I'd assumed that all files read from the console would automatically have the ".part" in the name but I guess not.
13 February, 18:46
This exercise is worded so goofily. I'm just now realizing the part of ordering the input streams. How are we supposed to order it if there's no ".part" attached?
20 February, 13:22
I made it fast and without checking on ".part" containing, maybe you did something wrong?
7 October 2021, 02:14
I solved this in only 2 tries, which I was really surprised by because while I was working on it I was convinced this was the hardest task yet, but then I looked at the solution to see how it was different from my code and felt bad because it has a lot in it that I don't understand. For example, why are they overriding a compare method when they don't even call the method at all in the rest of the code?
8 October 2021, 06:59
Read about Аnonymous Сlasses
20 February, 13:18
And read about functional programming, btw.))
14 April 2021, 14:18
Easier than I thought. One thing I misunderstood first: The filenames are entered line by line in the console, not with a comma like it is written in the example. like: /Users/test/Desktop/Folder/Lion.avi.part1 /Users/test/Desktop/Folder/Lion.avi.part2 ... end
30 December 2020, 08:39
Okay mates, don't f***** miss the point in ".<partN>".
28 January 2021, 15:07
16 December 2020, 12:02
Do not add a new line or anything between the files, even if it looks weird when testing.
7 October 2020, 18:41
"For example, Lion.avi." The dot at the end of this is a FULL STOP, not part of the filename that you need. The Filename should just be "Lion.avi"
14 September 2020, 21:32
If you have problems soloving this task, think carefully if you really need to use the "append" function when outputting.
24 August 2020, 03:54
This drove me insane, i think codegym needs to declare in the conditions which classes aren't allowed. for anyone else wondering, for some reason the vallidator does not want you to use the Java.io.File class, or at least some of the methods therein, i went mad trying to figure out why the output of my code was correct but it kept insisting i didn't close streams. whew.