Re: +calculateCharge():Void
Write a method called calculateCharge which has a void return type. I assume the + at the front means it is public. What specific part do you not understand?
Re: +calculateCharge():Void
I guess how to code it, I have no clue how to do a void return.
So far I have
Code :
public double calculateCharge()
{
}
Re: +calculateCharge():Void
Re: +calculateCharge():Void
so it would be
Code :
public double calculateCharge()
{
return 0;
}
?
Re: +calculateCharge():Void
:headdesk:
The main method is a void method. Surely you know what that looks like.
Re: +calculateCharge():Void
nope, im a complete java noob and am just looking to pass a class haha
Re: +calculateCharge():Void
See point 2 in the link above, quoted from the link:
Quote:
The return type—the data type of the value returned by the method, or void if the method does not return a value.
See the rest of that page (and further) to see method declarations with are defined with void.
Quote:
just looking to pass a class
To pass a class, or to learn...because these are different goals. Having a goal to learn will usually result in passing (and you come away with something), just doing something to pass and you miss out on the best part.