Answered step by step
Verified Expert Solution
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
Get Instant Access to Expert-Tailored Solutions
See step-by-step solutions with expert insights and AI powered tools for academic success
Step: 2
Step: 3
Ace Your Homework with AI
Get the answers you need in no time with our AI-driven, step-by-step assistance
Get Started