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
}
1
Expert's answer
2010-05-17T09:27:06-0400
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.
Comments
Leave a comment