1answer.
Ask question
Login Signup
Ask question
All categories
  • English
  • Mathematics
  • Social Studies
  • Business
  • History
  • Health
  • Geography
  • Biology
  • Physics
  • Chemistry
  • Computers and Technology
  • Arts
  • World Languages
  • Spanish
  • French
  • German
  • Advanced Placement (AP)
  • SAT
  • Medicine
  • Law
  • Engineering
anyanavicka [17]
4 years ago
12

Insert the missing code in the following code fragment. This fragment is intended to implement a method to assign a value to an

instance variable.
public class Vehicle
{
private String model;
private double rpm;
. . .
_______
{
model = modelName;
}
}
a) public void setModel(String modelName)
b) public void getModel()
c) public String getModel()
d) public String setModel(String modelName)
Computers and Technology
1 answer:
Viktor [21]4 years ago
5 0

Answer:

a) public void setModel(String modelName)

Explanation:

Writing methods for a class in java requires the optional access modifier (public, private or protected) followed by the return type (void, int, String etc), this is followed by the method's name and parameter list.

In the options given in the question above, only A and D come close to describing the method however option A is correct because this method is not expected to return a value when called hence return type is void

You might be interested in
Which loan type requires you to make loan payments while you’re attending school?
tigry1 [53]
Direct Subsidized Loans I believe
7 0
3 years ago
What time is it in Ohio?
skad [1K]
Geographically, the state of Ohio falls within the lines of latitude of 75 °W and 90 °W. The timezone corresponding to this portion of the globe is eastern standard time (EST). The prime meridian at 0 °, has the timezone greenwich mean time (GMT) from which all other timezones are referenced. And eastern standard time, local time in Ohio, will be 5 hours behind GMT.
5 0
3 years ago
Read 2 more answers
Which is a common problem caused by the widespread use of computers?
Andru [333]
Hacking would be a widespread problem.
8 0
4 years ago
Which of the following identifies the patterns used for each data series in a chart?
Lady_Fox [76]
The answer is A)Legend.
7 0
3 years ago
What is an example of a way a farm could apply new technology to improve sustainability?
Bess [88]

An example of a way a farm could apply new technology to improve sustainability is via the use artificial intelligence to predict and adjust the farm's water usage.

<h3>How is artificial intelligence used in farming?</h3>

The use of AI systems is one that can help to make better the total harvest quality and accuracy which is known to be precision agriculture.

Note that An example of a way a farm could apply new technology to improve sustainability is via the use artificial intelligence to predict and adjust the farm's water usage.

Learn more about sustainability from

brainly.com/question/26195041

#SPJ2

4 0
2 years ago
Other questions:
  • Which of the following is NOT an option in the comments group
    12·1 answer
  • Which part of a window lets you see a fileâs contents without opening the file?
    9·1 answer
  • Which of the following might indicate a source on the internet is NOT reliable?
    6·1 answer
  • When planning the structure of a spreadsheet, columns are for _______ items and rows are for _______ items.
    5·2 answers
  • After a suspected identity fraud case has been resolved, you should:
    5·1 answer
  • What characters cannot be used in a filename?
    15·1 answer
  • Tennis players are not allowed to swear when they are playing in Wimbledon
    6·2 answers
  • Question #5
    14·1 answer
  • Which external reference is formatted correctly?
    6·2 answers
  • Does The ps5 digital have a disc drive even Though ps4 games are not compatible
    6·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!