subject
Computers and Technology, 02.06.2021 20:30 hussja

public class Bird{private int beakStrength;public void Bird(int input){beakStrength = input;}public void setBeakStrength(int strength){beakStrength = strength;}}public class Hawk extends Bird{private int talonStrength;public Hawk(int talon, int beak){super(beak);talonStrength = talon;}}The following statement appears in a method in another class. Bird b = new Hawk(5, 8);Which of the following best describes the effect of executing the statement?A) The Bird variable b is instantiated as a Hawk. The instance variable talonStrength is initialized with the value from the parameter talon. The Hawk constructor cannot set the instance variable beakStrength because a subclass does not have access to a private variable in its superclass. B) The Bird variable b is instantiated as a Hawk. The call super(beak) returns a value from the instance variable beakStrength in the superclass and makes it accessible in the subclass. The instance variable talonStrength is then initialized with the value from the parameter talon. C) The Bird variable b is instantiated as a Hawk. The instance variable talonStrength is initialized with the value from the parameter talon. No other initializations are made to any instance variables. D) The Bird variable b is instantiated as a Hawk. The call super(beak) invokes the Bird constructor and initializes the instance variable beakStrength with the value from the parameter beak. The instance variable talonStrength is then initialized with the value from the parameter talon. E) The code segment will not execute because the Bird variable b cannot be instantiated as a Hawk.

ansver
Answers: 1

Another question on Computers and Technology

question
Computers and Technology, 22.06.2019 20:00
What is the term for water wave that is created by an underwater earthquake
Answers: 1
question
Computers and Technology, 23.06.2019 06:00
When is a chart legend used a. all the time b. whenever you are comparing data that is the same c. whenever you are comparing multiple sets of data d. only for hand-drawn charts
Answers: 2
question
Computers and Technology, 23.06.2019 06:00
What machine listens for http requests to come in to a website’s domain? a. a router b. a browser c. a server d. a uniform resource locator
Answers: 1
question
Computers and Technology, 23.06.2019 09:30
Why is an outfitting a workspace with video games in a technology development company considered a strategic use of money
Answers: 1
You know the right answer?
public class Bird{private int beakStrength;public void Bird(int input){beakStrength = input;}public...
Questions
question
Mathematics, 03.11.2019 23:31
question
History, 03.11.2019 23:31
question
Mathematics, 03.11.2019 23:31
question
Mathematics, 03.11.2019 23:31
Questions on the website: 13722362