Exception handling continuing the excecution This code is for continuing the execution after an exception, and this is ugly:

    int step=0;

    do{
        try{  
                switch(step)
                {
                case 0:
                    step=1;
                    methodAAAAACanThrowException();
                    break;
                case 1:
                    step=2;
                    methodBBBBBCanThrowException();
                    break;
                case 2:
                    step=3;
                    methodCCCCCanThrowException();
                    break;
                    //....

                    //more and more

                    //....
                case 25:
                    step=26;
                    methodZZZZZCanThrowException();                        
                }                      
        }catch( Exception ex)
        {  

            Logger.getLogger(ABC.class.getName()).log(Level.SEVERE, null, ex);
        }
    }while(step&lt;26);
}


but writing a single try-catch loop for every call, seems even uglier..

Is there any other more elegant option for doing that? 
thanks
How about something like this?

Define a one-method interface like so:

public interface TryAndLogFailure { void execute(); }


Then define a method which takes an object which implements the interface and does your exception handling for you:

public void tryAndLogFailure(TryAndLogFailure talf) {
  try {
    talf.execute();
  } catch (Exception e) {
    logger.log(...);
  }
}


Now your calls to the methods can be sequential:

tryAndLogFailure(new TryAndLogFailure{ public void execute() { methodAAAACanThrowException(); } });
tryAndLogFailure(new TryAndLogFailure{ public void execute() { methodBBBBCanThrowException(); } });
// etc...
tryAndLogFailure(new TryAndLogFailure{ public void execute() { methodZZZZCanThrowException(); } });


Admittedly, this could probably be worked a little more to make it prettier, but this is my first crack off the top of my head. If only Java had support for closures.

(Also - I should note that I agree with Winston. The reason why this code feels ugly is because the concept itself is ugly. Catching Exception is almost never a good idea and requires strong justification. Given more context, we may be able to help you redesign the code to avoid this sort of code smell.)