File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
http://aspose.com/file-tools
Win a copy of Clojure in Action this week in the Clojure forum!
    Bookmark Topic Watch Topic
  • New Topic

What if i want a return

 
Duc Nguy
Greenhorn
Posts: 7
  • 0
  • Mark post as helpful
  • send pies
  • Report post to moderator
What should i put if i want a return?
 
James Hobson
Ranch Hand
Posts: 140
  • 0
  • Mark post as helpful
  • send pies
  • Report post to moderator
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
Posts: 49
  • 0
  • Mark post as helpful
  • send pies
  • Report post to moderator
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
Posts: 986
Eclipse IDE Firefox Browser Tomcat Server
  • 0
  • Mark post as helpful
  • send pies
  • Report post to moderator
I feel like I am writing this program with Duc
line
by
line
 
It is sorta covered in the JavaRanch Style Guide.
    Bookmark Topic Watch Topic
  • New Topic