subject

Consider the following code segment for a class that models a fish:

public class Fish
{
private int age;
private double weight;
private boolean isAlive;
private Location location; // (x, y) location in a lake
...
}

Which of the following methods in the Fish class is the best candidate for being a instance method?

A. swim() // swim to a different location
B. eat() // fish eats
C. getLakeTemp() // get lake temperature
D. getAge() // returns age of fish
E. getWeight() // returns weight of fish

ansver
Answers: 2

Other questions on the subject: Computers and Technology

image
Computers and Technology, 22.06.2019 00:40, laurenrubin18
Write a function 'music_func' that takes 3 parameters -- music type, music group, vocalist -- and prints them all out as shown in the example below. in case no input is provided by the user, the function should assume these values for the parameters: "classic rock", "the beatles", "freddie mercury". for example: input: alternative rock, pearl jam, chris cornell output: the best kind of music is alternative rock the best music group is pearl jam the best lead vocalist is chris cornell note: the print statements will go inside the for example: print("the best kind of music is"
Answers: 2
image
Computers and Technology, 23.06.2019 06:30, eddsworldfrantic
You have a small company and want to keep your costs low, but it is important your employees share data. which network would provide you with the most economical solution?
Answers: 1
image
Computers and Technology, 23.06.2019 16:00, ginaaa20
Which analyst position analyzes information using mathematical models to business managers make decisions?
Answers: 1
image
Computers and Technology, 24.06.2019 02:10, trint5952
Aspeed limit sign that says "night" indicates the legal speed between sunset and sunrise.
Answers: 2
You know the right answer?
Consider the following code segment for a class that models a fish:

public class Fish

Questions in other subjects:

Konu
Mathematics, 17.02.2021 05:30