Computers and Technology

Ania has written this SimpleStopwatch class. In which line is she measuring the elapsed time? public class SimpleStopwatch
{
private long startingTime, endingTime;

public SimpleStopwatch()
{
startingTime = System. currentTimeMillis();
endingTime = System. currentTimeMillis();
}

public void start()
{
startingTime = System. currentTimeMillis();
return;
}

public void stop()
{
endingTime = System. currentTimeMillis();
return;
}

public long getDuration()
{
return endingTime - startingTime;
}
}

A. private long startingTime, endingTime;
B. startingTime = System. currentTimeMillis();
C. endingTime = System. currentTimeMillis();
D. startingTime = System. currentTimeMillis();
E. return endingTime - startingTime;

answer
Answers: 1

Other questions on the subject: Computers and Technology

image
Computers and Technology, 23.06.2019 00:30, lm18618
Which one of the following is considered a peripheral? a software b mouse c usb connector d motherboard
Answers: 2
image
Computers and Technology, 23.06.2019 12:30, umimgoingtofail
What is the difference between the internet and the world wide web?
Answers: 1
image
Computers and Technology, 23.06.2019 13:30, small77
Font size, font style, and are all aspects of character formatting.
Answers: 2
image
Computers and Technology, 23.06.2019 21:50, Trinhphuongtran
Description: write function lastfirst() that takes one argument—a list of strings of the format "lastname, firstname" —and returns a list consisting of two lists: (a) a list of all the last names (b) a list of all the first names
Answers: 2
Do you know the correct answer?
Ania has written this SimpleStopwatch class. In which line is she measuring the elapsed time? publi...

Questions in other subjects:

Konu
Mathematics, 10.03.2021 04:40