楼主: ReneeBK
1503 13

Java for the Beginning Programmer [推广有奖]

11
ReneeBK(未真实交易用户) 发表于 2016-9-3 09:08:02
  1. /**
  2. * MyClassArgument
  3. * Copyright 2006 by Jeff Heaton(jeff@jeffheaton.com)
  4. *
  5. * Example program from Chapter 6
  6. * Java for the Beginning Programmer
  7. * http://www.heatonresearch.com/articles/series/15/
  8. *
  9. * This class shows how to pass an argument to a method.
  10. *
  11. * This software is copyrighted. You may use it in programs
  12. * of your own, without restriction, but you may not
  13. * publish the source code without the author's permission.
  14. * For more information on distributing this code, please
  15. * visit:
  16. *    http://www.heatonresearch.com/hr_legal.php
  17. *
  18. * @author Jeff Heaton
  19. * @version 1.1
  20. */

  21. public class MyClassArgument
  22. {
  23.   public static void myMethod(int i)
  24.   {
  25.     i++;
  26.   }

  27.   public static void main(String args[])
  28.   {
  29.     int i = 10;
  30.     myMethod(i);
  31.     System.out.println("The value of i is " + i );
  32.   }
  33. }
复制代码

12
benji427(未真实交易用户) 在职认证  发表于 2016-9-3 11:32:41
谢谢分享

13
bbslover(真实交易用户) 在职认证  发表于 2016-9-3 20:33:47
thanks for sharing

14
xincan-wang(未真实交易用户) 发表于 2016-9-14 12:57:39
thank you for sharing

您需要登录后才可以回帖 登录 | 我要注册

本版微信群
jg-xs1
拉您进交流群
GMT+8, 2026-1-1 19:27