This week's book giveaway is in the Jobs Discussion forum.
We're giving away four copies of Soft Skills and have John Sonmez on-line!
See this thread for details.
The moose likes Beginning Java and the fly likes What if i want a return Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of Soft Skills this week in the Jobs Discussion forum!
JavaRanch » Java Forums » Java » Beginning Java
Reply locked New topic
Author

What if i want a return

Duc Nguy
Greenhorn

Joined: Nov 12, 2001
Posts: 7
What should i put if i want a return?
James Hobson
Ranch Hand

Joined: Aug 28, 2001
Posts: 140
return;
or if you want to return an int, you could do
public int myMethod() {
return 5;
}
I think you need to be more specific in your question.
James
Eric Johnson
Ranch Hand

Joined: Apr 30, 2001
Posts: 49
put the data type as the return type. if your code will return an int, put int. if it returns a string, put String. if it returns an object, put the object. for instance,

will return the int 3 to whatever calls it.
William Barnes
Ranch Hand

Joined: Mar 16, 2001
Posts: 986

I feel like I am writing this program with Duc
line
by
line


Please ignore post, I have no idea what I am talking about.
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: What if i want a return