subject
Computers and Technology, 08.03.2020 23:54 spobyyy

What will happen if the following program is run?

public class Test {
public static void main (String[] args) {
Test c = new Test();
c. m1();
}

public void m1() {
m2();
}

public void m2() {
String s = null;
System. out. println(s. toUpperCase());
}
}

1) A NullPointerException will be generated by method m2() and will stop in m2().
2) A NullPointerException will be thrown by method m2() and caught by method m1().
3) A NullPointerException will be thrown by method m2() and caught by main().
4) A NullPointerException will be thrown by method m2() and it will crash the program.

ansver
Answers: 1

Other questions on the subject: Computers and Technology

image
Computers and Technology, 23.06.2019 11:30, kieante01
The most accurate readings that you can take on an analog vom are when the meter's pointer is at the a. center scale. b. extreme right. c. near right. d. extreme left.
Answers: 1
image
Computers and Technology, 23.06.2019 13:00, jaelynnm
Donnie does not have powerpoint. which method would be best for elana to save and share her presentation as is? a pdf a doc an rtf a ppt
Answers: 3
image
Computers and Technology, 23.06.2019 20:30, kaylee2828
Column a of irma’s spreadsheet contains titles for each row, but her document is too big and will be printed three pages across. she wants to be sure that every page will be understood. what can irma do to with this problem?
Answers: 3
image
Computers and Technology, 23.06.2019 21:00, webbjalia04
Uget brainliest if accurate mary has been given the responsibility of hiring a person for the position of a software testing officer. which management function would mary achieve this responsibility?
Answers: 1
You know the right answer?
What will happen if the following program is run?

public class Test {
public stati...

Questions in other subjects:

Konu
Mathematics, 26.02.2021 03:50
Konu
Computers and Technology, 26.02.2021 03:50