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
Is a collection of information stored under a single name ​
oksian1 [2.3K]

\boxed{ File  } is a collection of information stored under a single name.

\bold{ \green{ \star{ \orange{Mystique35}}}}⋆

3 0
3 years ago
Read 2 more answers
Is this a scam pls tell me????????????/
zloy xaker [14]

Yes don't trust at all, I've got that so many times

3 0
4 years ago
Read 2 more answers
An electrician uses a device called a volt meter. The volt meter is an example of
kirill115 [55]

Answer:

hardware

Explanation:

A voltmeter can be defined as an electrical device used for measure voltage level or the amount of voltage present in a circuit.

In this scenario, an electrician uses a device called a volt meter. The volt meter is an example of hardware.

A hardware refers to any device, machine or equipment that can be handled physically (touched) and seen with the naked eyes. Other hardware components of a computer includes monitor, speaker, central processing unit, motherboard, hard-drive, joystick, mouse, keyboard, etc.

On the other hand, software component of a computer comprises of software application or program that are used by the computer to manage or control software application, computer hardware and user processes. Some examples of software components are operating system, registry keys, antivirus, media player, word processor, etc.

4 0
3 years ago
Which one of the following sstatements suggests a good method
PilotLPTM [1.2K]
The 2nd onnnnneeeeeee
7 0
3 years ago
Which of these is an online presentation tool?
Marina86 [1]
Google slides is and online presentation tool
5 0
3 years ago
Read 2 more answers
Other questions:
  • A(n)…………is the interface used toconnect external devices to the computer.
    5·1 answer
  • Add a throw statement to the processNumbers function that throws the message "All elements in the list should be numbers." if on
    12·1 answer
  • What programming language is used for Arduinos?
    6·2 answers
  • In this assessment, you will design and code a Java console application that validates the data entry of a course code (like IT4
    11·1 answer
  • Abdhbhbhsbfhsbhcvdhcbsdbhsvhgvhdsgvfhsgdvfhgdsvghcghvc
    10·2 answers
  • Hey i need some help with code.org practice. I was doing a code for finding the mean median and range. the code is supposed to b
    14·1 answer
  • Which of the following describes why graphical interfaces quickly became popular after their introduction to the mass market?
    5·1 answer
  • Is social media bringing people together or cause in sepretation?​
    11·2 answers
  • Ask the user to input a country name. Display the output the message “I
    8·1 answer
  • Label the parts of the plated salad.
    9·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!