I was wondering if it's an accepted way to call methods of classes within methods of classes within method of classes in Java like a cascade?
For example: Class_1 calls method from Class_2 and Class_2 calls a method from Class_3 and so on...
Or is this better: Class_1 calls method from Class_2. The return value is used to work with a method from Class_3 and so on... (-> one class handling all the method calls)
Another example: A class iterating over directories passing a value (like a file path) to a another class' method reading a specific file. Then again this class passes a value (like a line from the file) to a another class' method that analyses it. And then this class passes the result to another class' method again doing some other stuff with it.
Or is this better: A class calls a method that iterates over a directory. The return value (file path) is passed to another class' method called by the first class...
EDIT: Thanks for the answers!