470
Type: Posts; User: CrashOverride417
public int minFromMidnight()
{
return _hour+_minute*60;
}
??? like this
60*7+30
i got no idea how to do that
i managed to figure it out now to my next question how the method minFromMidnight will look like
this method returns how much minutes passed after midnightfor example if the time stored inside the...
public String toString() {
final StringBuilder sb = new StringBuilder ("Time1{");
sb.append ("_hour=").append (_hour);
sb.append (", _minute=").append (_minute);
...
it was with string.formatter and i am not allowed to use it
1. Testing Constructors and toString:
t1=com.company.Time1@1b6d3586
t2=com.company.Time1@4554617c
2. Testing accessors and mutators:
t1=com.company.Time1@1b6d3586
Hour of t1=20
Minute...
********** Test Time1 - Started **********
1. Testing Constructors and toString:
t1=17:45
t2=17:45
t33=00:00
2. Testing accessors and mutators:
t1=20:10
i am posting over and over and over and one more time over
package com.company;
import com.company.Time1;
public class Time1StudentTester
{
public static void main(String [] args) {
...
are you sure you know java ???? cause for now your not helping at all
i am asking if it can be replaced and if it can than with what ???
return String.format ("%02d:%02d",_hour,_minute);
this line can be replaced and still get same result ??? i just figured it out that i cant use string.format
so again same question how do i continue from this spot ?????
Error:(11, 20) java: constructor Time1 in class com.company.Time1 cannot be applied to given types;
required: int,int
found: com.company.Time1
reason: actual and formal argument lists differ...
thats why i need help understand how to continue from here
package com.company;
public class Time1 {
private int _hour;
private int _minute;
public Time1(int h, int m)
{
this._hour = (((h >= 0) && (h < 23)) ? h : 0);
...
package com.company;
public class Time1StudentTester
{
public static void main(String [] args) {
System.out.println("\n********** Test Time1 - Started **********\n");
...
it works but i dont recive the second output as 17:45 but as 00:00
i am required to build a class named Time1 and than run the test class on the Time 1 class to see its compiling without errors
public class Time1StudentTester
{
public static void...
1. Testing Constructors and toString:
t1=17:45
t2=17:45
this is first input i am missing the t2 = 17:45
System.out.println("\n********** Test Time1 - Started **********\n");
...
public Time1(int h, int m)
{
this._hour = (((h >= 0) && (h < 23)) ? h : 0);
this._minute = (((m >= 0) && (m < 59)) ? m : 0);
}
public String toString()
{
...
1. Testing Constructors and toString:
t1=17:45
t2=17:45
just help output this lines please and that will do enough
Time1 t2 = new Time1(t1);
System.out.println("\tt2=" + t2);
first line appears to be an object which requires construct in the main class file
so how can i duplicate the output ??? can you show me please