Computers and Technology

Analyze the following code:
public class test {
public static void main(string[] args) {
b b = new b();
b. m(5);
system. out. println("i is " + b. i);
}
}

class a {
int i;

public void m(int i) {
this. i = i;
}
}

class b extends a {
public void m(string s) {
}
}
a. the program has a compile error, because m is overridden with a different signature in b.
b. the program has a compile error, because b. m(5) cannot be invoked since the method m(int) is hidden in b.
c. the program has a runtime error on b. i, because i is not accessible from b.
d. the method m is not overridden in b. b inherits the method m from a and defines an overloaded method m in b.

answer
Answers: 1

Other questions on the subject: Computers and Technology

image
Computers and Technology, 22.06.2019 07:00, ayoismeisalex
Our primary purpouse as electricians is to do wich of the following core concepts? a: install electrical components in a way they can be upgraded b: install electrical equiptment in a way that reduces heat c: install electrical systems in a safe manner d: only b and c
Answers: 1
image
Computers and Technology, 22.06.2019 10:00, kimmmmmmy333
According to alisa miller foreign news bureaus
Answers: 3
image
Computers and Technology, 23.06.2019 04:31, hargunk329
Q13 what function does a security certificate perform? a. creates user accounts b. scrambles data c. identifies users d. creates password policies e. provides file access
Answers: 1
image
Computers and Technology, 23.06.2019 07:30, emilyplays474
What key should you press and hold to select and open multiple files at one time? enter alt control esc
Answers: 1
Do you know the correct answer?
Analyze the following code:
public class test {
public static void main(string[] args)...

Questions in other subjects:

Konu
Chemistry, 17.04.2020 05:13