Q.- Given:-
1. public class App {
2. public static void main(String [ ] args) throws LogFileException {
3. App obj = new App( );
4. try {
5. obj.open ( );
6. obj.process( );
7. // insert code here
8. }
9. catch(Exception ex)
10. {
11. System.out.println("Completed...");
12. }
13. }
14. public void process( ) {
15. System.out.println("Processed...");
16. throw new LogFileException( );
17. }
18. public void open( ) {
19. System.out.println("Opened...");
20. throw new AccessViolationException( );
21. }
22. }
which action fixes the compiler error ?
A) At line 2 , replace throws LogFileException with throws AccessViolationException
B) At line 14 , add throws LogFileException
C) At line 18, add throws AccessViolationException
D) At line 7 , insert throws LogFileException( );
1. public class App {
2. public static void main(String [ ] args) throws LogFileException {
3. App obj = new App( );
4. try {
5. obj.open ( );
6. obj.process( );
7. // insert code here
8. }
9. catch(Exception ex)
10. {
11. System.out.println("Completed...");
12. }
13. }
14. public void process( ) {
15. System.out.println("Processed...");
16. throw new LogFileException( );
17. }
18. public void open( ) {
19. System.out.println("Opened...");
20. throw new AccessViolationException( );
21. }
22. }
which action fixes the compiler error ?
A) At line 2 , replace throws LogFileException with throws AccessViolationException
B) At line 14 , add throws LogFileException
C) At line 18, add throws AccessViolationException
D) At line 7 , insert throws LogFileException( );
3 Comments
C
ReplyDeleteC
ReplyDeleteC
ReplyDelete