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 11:00
Eva has many contacts on the professional networking site she uses which contacts are considered second degree
Answers: 3
question
Computers and Technology, 22.06.2019 12:40
How do i get the most points, without any effort?
Answers: 2
question
Computers and Technology, 22.06.2019 17:30
1. before plugging in a new device to a computer you should unplug all other devices turn off the computer turn on the computer 2. many of the maintenance tools for a computer can be found in the control panel under administrative tools display personalization
Answers: 1
question
Computers and Technology, 23.06.2019 11:20
Http is the protocol that governs communications between web servers and web clients (i.e. browsers). part of the protocol includes a status code returned by the server to tell the browser the status of its most recent page request. some of the codes and their meanings are listed below: 200, ok (fulfilled)403, forbidden404, not found500, server errorgiven an int variable status, write a switch statement that prints out the appropriate label from the above list based on status.
Answers: 2
You know the right answer?
public class Bird{private int beakStrength;public void Bird(int input){beakStrength = input;}public...
Questions
question
Mathematics, 23.03.2020 16:54
question
Mathematics, 23.03.2020 16:55
question
History, 23.03.2020 16:55
question
Mathematics, 23.03.2020 16:55