Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

java code write a static method getRandomTime() that uses an instance of Random to generate a random time in hour and minutes. the hour must

java code

write a static method getRandomTime() that uses an instance of Random to generate a random time in hour and minutes. the hour must be between 1 and 12, both inclusive. the minute must between 0 and 59, both inclusive. the method should return a string of the form hour:minute, such as 12:19 or 1:6. you did not need to worry about pending hour or minute with leading zeros.

import java.util.Random;

public class someclass{

public static string getRandomTime{

}

}

Step by Step Solution

There are 3 Steps involved in it

Step: 1

blur-text-image

Get Instant Access to Expert-Tailored Solutions

See step-by-step solutions with expert insights and AI powered tools for academic success

Step: 2

blur-text-image

Step: 3

blur-text-image

Ace Your Homework with AI

Get the answers you need in no time with our AI-driven, step-by-step assistance

Get Started

Recommended Textbook for

Demystifying Databases A Hands On Guide For Database Management

Authors: Shiva Sukula

1st Edition

8170005345, 978-8170005346

More Books

Students also viewed these Databases questions