#How to do this OOP?
15 messages · Page 1 of 1 (latest)
Hey, @rose geode!
Please remember to /close this post once your question has been answered!
what information do you want to extract ?
is this the exact layout or should line two and three also be separated by a comma
for example length for every list
i know methods but how to do this oop
separate for two classes?
so length of every line ?
length of every line, sort by alphabetically etc . I have methods but i dont know how to do this oop
I mean you could package all your methods in a class called FileInformation or something which accepts the path of the file , creates a buffered reader and is able to perform your required tasks
yes but new class for save this to new txt?
you can use the same class for that.
you are still only operating on one single file
yes but its not oop
FileReader class: responsible for reading the text file and extracting the individual lines of text from it.
LineProcessor class: responsible for processing each line of text from the file and checking its length, etc.
FileWriter class: responsible for writing the processed lines of text to a new text file.
:]