Re: Java code not compiling!
What is that method declared to return?
For instance this method is declared to return an int:
Code:
public int foo() { // this line shows the method is declaring that it will return an int
return 3;
}
What is it in fact trying to return?
Re: Java code not compiling!
Quote:
Originally Posted by
Fubarable
What is that method declared to return?
For instance this method is declared to return an int:
Code:
public int foo() { // this line shows the method is declaring that it will return an int
return 3;
}
What is it in fact trying to return?
ok I see, the problem was
Quote:
public Time getDescription()
{
return deliveredTime;
}
its meant to be "Time" lol
Re: Java code not compiling!
You fixed two things:
1) the return type of the method and
2) what it returns.
The method couldn't return 'dt' because it only existed in another method; 'deliverTime' can be returned because:
1) it exists (it's an object member variable) and
2) it has the right type.
kind regards,
Jos