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
Which is a requirement for searching for a template
Lina20 [59]

Answer:

umm... you did not discribe the anwsers, i cannot help you

8 0
3 years ago
Hello can you please help with this if you want to thank you!
nikklg [1K]

Answer:

hardware and software is the answer

8 0
3 years ago
Read 2 more answers
True / False<br> Generally, more orthogonal instruction sets are considered less elegant.
Cerrena [4.2K]

Answer: True

Explanation:Orthogonal instruction set is the set of instruction that can use can use all addressing mode. They have independent working and so instruction can use any register the prefer and this leads to overlapping in instruction and complexity.

When RISC architecture got introduced ,it got more preference due to reduced instruction and less complexity as compared to orthogonal instruction.So it not considered elegant to have more orthogonal instruction.

6 0
3 years ago
Write a grammar for the language consisting of strings that have n copies of the letter a followed by the same number of copies
Mazyrski [523]

Answer:

def language(mystring, n):

   if n > 0:

       string_list = [x for x in mystring]

       string_cont = ""

       for character in string_list:

           string_cont += character * n

       print(string_cont)

Explanation:

When n is equal to 0, that is, n=0, The python program multiplies the characters of the string "mystring" by the integer variable "n" to output a string with all characters with the same count.

7 0
3 years ago
A programming error that causes a program to generate incorrect results due to failing to use the proper combination of statemen
tino4ka555 [31]

Answer:

Logic error.

Explanation:

Logic error is that type of error in the programming language in which the outcome of the program is incorrect due to the fault on implementing the logic in the program by the programmer, it gives output but that output is incorrect.

<u>For example</u>:

If the programmer wants to create the program of the greater than and he implements wrongly '>' to '<' then the following program returns output but that output is incorrect.

7 0
4 years ago
Other questions:
  • Two users, UserA and UserB, are engaging in secure communication using only asymmetrical encryption. UserA needs to send a secur
    11·1 answer
  • Which invention provided instant communication and information to a massive audience for the first time?
    9·2 answers
  • ____ is a general term that includes all products of the human mind, including original ideas.
    5·1 answer
  • Which type of microphone uses two metal plates?
    7·1 answer
  • C programming: loading a dictionary into a trie data structure. Why am I segfaulting?
    8·1 answer
  • federal law requires public libraries to install filtering software on computers to prevent children from accessing adult conten
    14·1 answer
  • )In a graph represented by adjacency matrix u can find all the neighbours of a given vertices in ____Operations
    6·1 answer
  • Write a program which will enter information relating to a speeding violation and then compute the amount of the speeding ticket
    14·1 answer
  • How does Map Put function work in Java? *
    12·1 answer
  • Need this java code its on zybooks. given two integers as user inputs that represent the number of drinks to buy and the number
    14·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!