#How to do this OOP?

15 messages · Page 1 of 1 (latest)

tawdry edgeBOT
#

Hey, @rose geode!
Please remember to /close this post once your question has been answered!

fringe iris
#

what information do you want to extract ?

#

is this the exact layout or should line two and three also be separated by a comma

rose geode
#

for example length for every list

#

i know methods but how to do this oop

#

separate for two classes?

fringe iris
rose geode
#

length of every line, sort by alphabetically etc . I have methods but i dont know how to do this oop

fringe iris
#

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

rose geode
#

yes but new class for save this to new txt?

fringe iris
#

you can use the same class for that.

#

you are still only operating on one single file

rose geode
#

yes but its not oop

chrome leaf
#

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.

:]