I wanted to know if this code was right and if not what needs to be fixed?
public class Time
{
public static void main(String[] args)
{
int Time = 197;
int hours=3;
int minutes=17;
{
int hours =3;
int left = 17;
System.out.println("197 minutes is 3 hours and 17 minutes");
} // end class Time
}
No, your code is wrong. Try to use this:
public class Drive
{
public static void main(String[] args)
{
Time time = new Time();
time.setMinutes(197);
System.out.println(time.toString());
} // end class Drive
}
Try to combine our answers and you'll get a solution for your problem.
Need a fast expert's response?
Submit order
and get a quick answer at the best price
for any assignment or question with DETAILED EXPLANATIONS!
Learn more about our help with Assignments:
JavaJSPJSF