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

Another question on Computers and Technology

question
Computers and Technology, 21.06.2019 21:00
If you have a lien on your vehicle, you cannot apply for a duplicate copy of your vehicle’s certificate of title. true or false
Answers: 1
question
Computers and Technology, 22.06.2019 11:00
Ihave an iphone 8plus should i get another phone like samsung note 9 or s9 ? ?
Answers: 2
question
Computers and Technology, 22.06.2019 18:00
Write a method named addall that could be placed inside the hashintset class. this method accepts another hashintset as a parameter and adds all elements from that set into the current set, if they are not already present. for example, if a set s1 contains [1, 2, 3] and another set s2 contains [1, 7, 3, 9], the call of s1.addall(s2); would change s1 to store [1, 2, 3, 7, 9] in some order. you are allowed to call methods on your set and/or the other set. do not modify the set passed in. this method should run in o(n) time where n is the number of elements in the parameter set passed in.
Answers: 2
question
Computers and Technology, 23.06.2019 02:00
Arecipients list has been loaded into a document. which commands should be clicked in order to filter the list so that letters will not be printed for recipients who live in a certain state? mailings tab, start mail merge, select recipients, type new list, then insert only contacts from the desired states mailings tab, rules, select recipients, use existing list, then choose a recipients list that includes only contacts in certain states mailings tab, select recipients, use existing list, rules, fill in, then type in certain states mailings tab, rules, skip record select “state” under field name, then type in the state name under “equal to”
Answers: 2
You know the right answer?
What will happen if the following program is run?

public class Test {
public stati...
Questions
question
Mathematics, 24.09.2019 15:00
question
Mathematics, 24.09.2019 15:00
Questions on the website: 13722367