Advertisement
theSwamz

Nautilus Labs Assignment

Apr 19th, 2021
1,634
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Java 5 0.47 KB | None | 0 0
  1. //To improve on style, simplicity and maintainability I would break up this function with 4 nested ifs into separate functions
  2.  
  3. public boolean  f(){
  4.     if(A){
  5.         z();
  6.     }
  7.     else{
  8.         s();
  9.         return false;
  10.     }
  11. }
  12.  
  13. public boolean z(){
  14.     if(B){
  15.         y();
  16.     }
  17.     else{
  18.         t();
  19.         return false;
  20.     }
  21. }
  22.  
  23. public boolean y(){
  24.     if(C){
  25.         x();
  26.     }
  27.     else{
  28.         u();
  29.         return false;
  30.     }
  31. }
  32.  
  33. public boolean x(){
  34.     if(D){
  35.         w();
  36.         return true;
  37.     }
  38.     else{
  39.         v();
  40.         return false;
  41.     }
  42. }
  43.        
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement