subject

What is the output of following program: public class test { public static void main(string[] args) { a a = new a(); a. methodb(); } } class a { public a() { system. out. println("a's constructor is executed"); } public void methoda() { system. out. println("methoda is executed"); } public void methodab() { system. out. println("a's methodab is executed"); } } class b extends a { private int num = 0; public b() { super(); system. out. println("b's constructor is executed"); } public b (int n) { num = n; system. out. println("b's constructor is executed"); } public void methodb() { system. out. println("num is " + num); system. out. println("methodb is executed"); } public void methodab() { system. out. println("b's methodab is executed"); } }

ansver
Answers: 3

Another question on Computers and Technology

question
Computers and Technology, 23.06.2019 07:30
Write a program that inserts the digits of an integer into an array in originalorderfollowed by reverse order. first, promptthe user to enter a positive integer(> 0). determine the number of digits of the integer. create a dynamically allocated integer arrayof a size twice the number of digits.now insert the digits in original order which will occupy half of the array. then, insert the digits in reverse order.finally, output thedigits in thearray.use at least two functions to organize your program.
Answers: 3
question
Computers and Technology, 23.06.2019 18:30
This program should be a short piece of code that prints all of the positive integers from 1 to 100 as described more fully below. the program may contain multiple methods, and if using an oo language, should be contained within a single class or object. the program should be designed so that it begins execution when invoked through whichever mechanism is most common for the implementation language. â–ş print out all positive integers from 1 to 100, inclusive and in order. â–ş print messages to standard output, matching the sample output below. â–ş in the output, state whether the each integer is 'odd' or 'even' in the output. â–ş if the number is divisible by three, instead of stating that the number is odd or even, state that the number is 'divisible by three'. â–ş if the number is divisible by both two and three, instead of saying that the number is odd, even or divisible by three; state that the number is 'divisible by two and three'. â–ş design the logic of the loop to be as efficient as possible, using the minimal number of operations to perform the required logic. sample output the number '1' is odd. the number '2' is even. the number '3' is divisible by three. the number '6' is divisible by two and three.
Answers: 1
question
Computers and Technology, 23.06.2019 21:20
For positive constants a and b, the force between two atoms in a molecule is given f(r) = −a r2 + b r3 , where r > 0 is the distance between the atoms. note: a and b are upper case letters. (a) find f '(r) = (b) find the critical point for f(r). r = (c) find f ''(r) = (d) find the value of r so that f ''(r) = 0.
Answers: 1
question
Computers and Technology, 24.06.2019 05:50
What all vehicles has tesla inc. created over the years
Answers: 3
You know the right answer?
What is the output of following program: public class test { public static void main(string[] args)...
Questions
question
English, 17.09.2020 14:01
question
Mathematics, 17.09.2020 14:01
question
Mathematics, 17.09.2020 14:01
question
Mathematics, 17.09.2020 14:01
question
Mathematics, 17.09.2020 14:01
question
Mathematics, 17.09.2020 14:01
question
Computers and Technology, 17.09.2020 14:01
question
Mathematics, 17.09.2020 14:01
question
Mathematics, 17.09.2020 14:01
question
Mathematics, 17.09.2020 14:01
question
Mathematics, 17.09.2020 14:01
question
Mathematics, 17.09.2020 14:01
question
Mathematics, 17.09.2020 14:01
question
Chemistry, 17.09.2020 14:01
question
English, 17.09.2020 14:01
question
Mathematics, 17.09.2020 14:01
question
Mathematics, 17.09.2020 14:01
question
English, 17.09.2020 14:01
question
Mathematics, 17.09.2020 14:01
question
Mathematics, 17.09.2020 14:01
Questions on the website: 13722360