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
jeyben [28]
3 years ago
9

Write a program that creates a Date object, sets its elapsed time to 10000, 100000, 1000000, 10000000, 100000000, 1000000000, 10

000000000, and 100000000000, and displays the date and time using the toString()
Computers and Technology
1 answer:
Lady bird [3.3K]3 years ago
3 0

Answer:

Explanation:

The following Java program creates various Date objects for each one of the provided milliseconds in the question. Then it calls the toString() method on each one. The last two milliseconds were not included because as a long variable they are too big for the Date object to accept. The code has been tested and the output is shown in the image below.

import java.util.Date;

class Brainly {

   public static void main(String[] args) {

       Date date = new Date();

       date.setTime(10000);

       System.out.println(date.toString());

       Date date2 = new Date();

       date2.setTime(100000);

       System.out.println(date2.toString());

       Date date3 = new Date();

       date3.setTime(1000000);

       System.out.println(date3.toString());

       Date date4 = new Date();

       date4.setTime(10000000);

       System.out.println(date4.toString());

       Date date5 = new Date();

       date5.setTime(100000000);

       System.out.println(date5.toString());

       Date date6 = new Date();

       date6.setTime(1000000000);

       System.out.println(date6.toString());

   }

}

You might be interested in
Select all that apply. Listening is a physical, mental, and emotional process. It involves:
olga2289 [7]
Hearing understanding evaluating
4 0
3 years ago
Read 2 more answers
Gina is upgrading your computer with a new processor. She installed the processor into your motherboard and adds the cooling sys
tigry1 [53]

Answer:

The answer is option d.

8 0
3 years ago
Read 2 more answers
Which of the following is an accurate explanation of what this paragraph means?
LuckyWell [14K]

Answer:

fifty five years later he burned out the same person who had to go and he said that the same person you met in a long period and I have been on my side and you know what I mean to him but she is the one I want her out and then she has a good time for me to get to the point where I don't know her I would have

4 0
4 years ago
What tool extends the basic functionality provided in task manager with additional features and tools?
Firdavs [7]
Answer: Resource monitor.
8 0
4 years ago
Variables make it easier to do what?
defon
<span>D. Make changes to your code
Variables allow the ability to easily substitute numbers for other numbers.
</span>
8 0
4 years ago
Other questions:
  • Will mark brainliest if correct. First come, first serve.
    15·1 answer
  • Suppose there is a class Roster. Roster has one variable, roster, which is a List of tuples containing the names of students and
    6·1 answer
  • The size and mass of Mars is similar to the Earth.<br><br> True<br> False
    12·2 answers
  • You have successfully compiled the file Hi.java, how do you run the corresponding program from the command line?
    7·1 answer
  • Is this a scam pls tell me????????????/
    7·2 answers
  • Suppose that the format for license plates in a certain state is two letters followed by four numbers. (a) How many different pl
    6·1 answer
  • A function ________ contains the statements that make up the function.
    5·1 answer
  • Fitbit is an example of....
    15·2 answers
  • Why is weather forecast so important for hang gliders?
    12·1 answer
  • Which tab allows you to review the slideshow timings?<br> O Home<br> O View<br> O Review<br> O File
    7·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!