✅ 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 {
}
public class MissingDataException extends DataException {
}
y asumiendo que el siguiente método está definido y accesible:
public void cleanData(String s)
throws MissingDataException, CorruptedDataException {
if (s == null) throw new MissingDataException();
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 “Line 1” y “Line 2”:
public static void main(String[] args) ________[1]_________ {
try {
cleanData( null );
cleanData( "data" );
} _________[2]_________ {
System.out.println( "Line 1" );
} _________[3]_________ {
System.out.println( "Line 2" );
}
}
Get Unlimited Answers To Exam Questions - Install Crowdly Extension Now!