Description
How do i write a method partitionFile which takes as input a String souce a String destination and an int n. Using the class MultiBufferedWriter( which i have written out already and it compiles) it should partition the source file into several files with the pattern destination + i for ranges of i to 1 until n.
Explanation & Answer
This looks like exactly the same question that I answered for another asker just today!
Assuming that your MultiBufferedWriter class is the same then add this main method:
public static void main( String[] args) throws IOException{
String fileIn = "KhanakTheMagnificent";
new MultiBufferedWriter( fileIn, 3);
}
This constructs what is known as an anonymous object. The object exists because it was constructed but has no name and thus cannot be referenced later. It doesn't matter because it's only invocation of the constructor that is required.
Here's the link to where I had posted this earlier today so that you can see that other asker's class:
https://www.likeplum.com/questions/4472/java-write-a-method-partitionfile
Review
Review
24/7 Homework Help
Stuck on a homework question? Our verified tutors can answer all questions, from basic math to advanced rocket science!
Similar Content
Related Tags
The Age of Innocence
by Edith Wharton
Freakonomics
by Stephen J. Dubner and Steven D. Levitt
Girl Stop Apologizing
by Rachel Hollis
The Secret Life of Bees
by Sue Monk Kidd
Killers of the Flower Moon
by David Grann
Of Mice and Men
by John Steinbeck
The President is Missing
by James Patterson, Bill Clinton
Wuthering Heights
by Emily Brontë
Mrs Dalloway
by Virginia Woolf