What is the best possible way to chain methods together? In my scenario, there are four methods. If the output of the first method is true, it has to call the second method.
For Example:
flag = method1();
if (flag){
flag = method2();
}
if (flag){
method3();
}
// and so on for next methods ..