User Name Password Register
DaniWeb IT Discussion Community
All
What is DaniWeb IT Discussion Community?
You're currently browsing the Java section within the Software Development category of DaniWeb, a massive community of 373,570 software developers, web developers, Internet marketers, and tech gurus who are all enthusiastic about making contacts, networking, and learning from each other. In fact, there are 3,846 IT professionals currently interacting right now! Registration is free, only takes a minute and lets you enjoy all of the interactive features of the site.
Please support our Java advertiser: Lunarpages Java Web Hosting
Sep 20th, 2004
Views: 2,637
A short example of passing variables between methods (functions).
java Syntax | 1 stars
  1. package methodexample;
  2. public class MethodExample
  3. {
  4. public static void main(String args[])
  5. {
  6. int y = 2, z = 0;
  7. z = twoTimes(2);
  8. System.out.print("\n\n\t" + (y + z));
  9. }
  10. public static int twoTimes(int y)
  11. {
  12. y = 2 * y;
  13. return y;
  14. }
  15. }
Comments (Newest First)
p.bondam | Newbie Poster | Jan 5th, 2007
hi Queen,

this is really a very intriguing example...

what were you thinking at the time=

by the way...when in this comment/area, my keyboard is acting strange, showing equal/signs instead of question-marks, and slashes instead of minus/signs...and so on.
in my browser or java shell all is still ok.

any idea =;

greetings from

peter bondam
Post Comment

Only community members can submit or comment on code snippets. You must register or log in to contribute.

DaniWeb Marketplace (Sponsored Links)
All times are GMT -4. The time now is 7:41 am.
Forum system based on vBulletin Copyright ©2000 - 2008, Jelsoft Enterprises Ltd.
©2003 - 2008 DaniWeb® LLC