logo

Crowdly

Dadas las siguientes clases:       public class DataException extends E...

✅ The verified answer to this question is available below. Our community-reviewed solutions help you understand the material better.

Dadas las siguientes clases:

      public class DataException extends

Exception {

      }

      public class CorruptedDataException extends DataException {

      }

y asumiendo

que el siguiente método está definido y accesible:

       public void cleanData(String s) throws DataException {

             if (s == null) throw new DataException();

             if (s.contains("@")) throw new CorruptedDataException();

       }

indica cómo

se deben rellenar los espacios subrayados (numerados entre corchetes) para que

el siguiente código sea correcto y al ejecutarse imprima solamente “Line 1”:

       public static void main(String[] args) ________[1]_________

 

{

             try {

                      cleanData( "f@5" );

             }  _________[2]_________  {

                      System.out.println( "Line 1" );

             }  _________[3]_________  {

                      System.out.println( "Line 2"

 

);

             }

       }

0%
0%
0%
0%
More questions like this

Want instant access to all verified answers on moodle.uam.es?

Get Unlimited Answers To Exam Questions - Install Crowdly Extension Now!