Core Java| JSP| Servlets| XML| EJB| JEE5| Web Services| J2ME| Glossary| Questions? | Software Development
 

Return Java Keyword

The return is a keyword defined in the java programming language.

Return Java Keyword

                         

The return is a keyword defined in the java programming language. Keywords are basically reserved words which have specific meaning relevant to a compiler in java programming language likewise the return keyword indicates the following :  

--  The return keyword is always used with a method only to specify that the method is going to return something.
--  The return keyword forces a method to return to the method calling it.
--  The return keyword passes a value back to the calling method after matching the
return type of the called method.
-- 
If there is void return type it means it is returning nothing back to the called function. 
-- 
If the method has a non−void return type, the return statement must have an argument of the same or a compatible type.

Using a return Keyword within a class, with a method

A method returning nothing

public void Void_Method()

{

<statements>

return;

}

A method returning a String

public String String_Method()

{

String s = "its Ridiculous to do such kind of work, people here are just aim less";

return s;

}

A method returning an Int value 

public int Int_Method()

{

int i = 5;

return(i);

}

                         

» View all related tutorials
Related Tags:

Leave your comment:

Name:

Email:

URL:

Title:

Comments:


Enter Code:

Audio Version
Reload Image
 

Note: Emails will not be visible or used in any way, and are not required. Please keep comments relevant. Any content deemed inappropriate or offensive may be edited and/or deleted.

No HTML code is allowed. Line breaks will be converted automatically. URLs will be auto-linked. Please use BBCode to format your text.

Add This Tutorial To:
  Del.icio.us   Digg   Google   Spurl   Blink   Furl   Simpy   Y! MyWeb 
 
Tell A Friend
Your Friend Name

 

 
Recently Viewed
Software Solutions
Search Tutorials

 

 
 

Home | JSP | EJB | JDBC | Java Servlets | WAP  | Free JSP Hosting  | Search Engine | News Archive | Jboss 3.0 tutorial | Free Linux CD's | Forum | Blogs

About Us | Advertising On RoseIndia.net  | Site Map

India News

Send your comments, Suggestions or Queries regarding this site at roseindia_net@yahoo.com.

Copyright © 2008. All rights reserved.