Academic Integrity: tutoring, explanations, and feedback — we don’t complete graded work or submit on a student’s behalf.

Here is a method definition: int compute( int a, double y){..} Which of the foll

ID: 3835960 • Letter: H

Question

Here is a method definition: int compute( int a, double y){..} Which of the following has a different signature? int compute( int sum, double value) {..} double compute(int a, double y) {..} double compute( int sum, double y) {..} Here is an abstract method defined in the parent: public abstract int sumup (int[]arr); Which of the following is required in a non-abstract child? public abstract int sumup (int[]arr) {hellip} public int sumup (int[]arr) { hellip } public double sumUp (int[] arr){hellip} public int sumup (long[] arr) {hellip} Here is a situation: Birthday happy; happy = new AdultBirthday("Joe", 39); happy.greeting(); which greeting[]; Which greeting() method is run: the one defined for Birthday or the one defined for Adult Birthday? The one defined for Birthday because that is the type of the variable happy. The one defined for AdultBirthday because that is the type of the object referred to by happy. The one closest in the source code to the happy greeting() statement Neither-the assignment statement is in error. Is there something wrong with the following class? If so, identify the line number points) and correct it. public class Animal{ protected String name; public string getName(){ return name; } public abstract string animalRoar(); }

Explanation / Answer

8.signature of the method is the name of the method and the number of and type of parameters

here here option d has the different type of parameter so it can be considered as the differenty signatured

so answer is int compute(int a,int y)

9.option b is the correct answer abstract method should be implemented in the child class without the abstract keyword,the method should be overriden

10.option d is correct answer because birthday cannot be converted into adultirthday

11.line number 6 has the error in the keyword string

the correct one is

public abstract String animalRoar();

Hire Me For All Your Tutoring Needs
Integrity-first tutoring: clear explanations, guidance, and feedback.
Drop an Email at
drjack9650@gmail.com
Chat Now And Get Quote