Re: Java 101 ? question about return values (lost)
Re: Java 101 ? question about return values (lost)
- Subject: Re: Java 101 ? question about return values (lost)
- From: Chuck Hill <email@hidden>
- Date: Fri, 20 May 2005 18:56:48 -0700
At 06:19 PM 20/05/2005 -0700, WebObjects wrote:
>Question: I am calling a function (with boolean return value) in an
>instantiated class like so...
>
>TaskReview review = new TaskReview(); //TaskReview.java is a class
>review.GetRepsData();
>
To follow Java coding conventions and keep key-value coding happy,
GetRepsData should start with a lower case g.
>....but, "GetRepsData();" is defined to return a value (a boolean). As you
>can see, "review.GetRepsData();" doesn't assign the returned value, and
>there are no compilation errors or runtime errors. Why?
Um, 'cause that's how Java and most simlar languages work?
>Why doesn't the
>call to this function w/out assigning the return value create any problems?
Why should it? Do you need more problems in your code? :-P
>And where is my mandated return value disappearing to?
>
It is with the spirit of Dev Null in the great bit bucket in the sky.
Gone, never to be seen again.
>I realize this isn't a Java mailing list, but you've all been very generous
>in support of Java questions in context to WO dev, and I appreciate it.
>
I don't know how much that helped you, but I had fun writing it. ;-) Java
is quite happy to ignore return values. Doing something with them is fully
optional.
Chuck
--
Practical WebObjects - a book for intermediate WebObjects developers
who want to increase their overall knowledge of WebObjects, or those
who are trying to solve specific application development problems.
http://www.global-village.net/products/practical_webobjects
_______________________________________________
Do not post admin requests to the list. They will be ignored.
Webobjects-dev mailing list (email@hidden)
Help/Unsubscribe/Update your Subscription:
This email sent to email@hidden