<?xml version="1.0"?>
<feed xmlns="http://www.w3.org/2005/Atom" xml:lang="ru">
		<id>http://www.jexp.ru/index.php?action=history&amp;feed=atom&amp;title=Java_Tutorial%2FClass_Definition%2FMethod_Parameters</id>
		<title>Java Tutorial/Class Definition/Method Parameters - История изменений</title>
		<link rel="self" type="application/atom+xml" href="http://www.jexp.ru/index.php?action=history&amp;feed=atom&amp;title=Java_Tutorial%2FClass_Definition%2FMethod_Parameters"/>
		<link rel="alternate" type="text/html" href="http://www.jexp.ru/index.php?title=Java_Tutorial/Class_Definition/Method_Parameters&amp;action=history"/>
		<updated>2026-04-24T02:50:03Z</updated>
		<subtitle>История изменений этой страницы в вики</subtitle>
		<generator>MediaWiki 1.30.0</generator>

	<entry>
		<id>http://www.jexp.ru/index.php?title=Java_Tutorial/Class_Definition/Method_Parameters&amp;diff=4216&amp;oldid=prev</id>
		<title>Admin: 1 версия</title>
		<link rel="alternate" type="text/html" href="http://www.jexp.ru/index.php?title=Java_Tutorial/Class_Definition/Method_Parameters&amp;diff=4216&amp;oldid=prev"/>
				<updated>2010-06-01T05:00:48Z</updated>
		
		<summary type="html">&lt;p&gt;1 версия&lt;/p&gt;
&lt;table class=&quot;diff diff-contentalign-left&quot; data-mw=&quot;interface&quot;&gt;
				&lt;tr style=&quot;vertical-align: top;&quot; lang=&quot;ru&quot;&gt;
				&lt;td colspan=&quot;1&quot; style=&quot;background-color: white; color:black; text-align: center;&quot;&gt;← Предыдущая&lt;/td&gt;
				&lt;td colspan=&quot;1&quot; style=&quot;background-color: white; color:black; text-align: center;&quot;&gt;Версия 05:00, 1 июня 2010&lt;/td&gt;
				&lt;/tr&gt;&lt;tr&gt;&lt;td colspan=&quot;2&quot; style=&quot;text-align: center;&quot; lang=&quot;ru&quot;&gt;&lt;div class=&quot;mw-diff-empty&quot;&gt;(нет различий)&lt;/div&gt;
&lt;/td&gt;&lt;/tr&gt;&lt;/table&gt;</summary>
		<author><name>Admin</name></author>	</entry>

	<entry>
		<id>http://www.jexp.ru/index.php?title=Java_Tutorial/Class_Definition/Method_Parameters&amp;diff=4215&amp;oldid=prev</id>
		<title> в 17:44, 31 мая 2010</title>
		<link rel="alternate" type="text/html" href="http://www.jexp.ru/index.php?title=Java_Tutorial/Class_Definition/Method_Parameters&amp;diff=4215&amp;oldid=prev"/>
				<updated>2010-05-31T17:44:27Z</updated>
		
		<summary type="html">&lt;p&gt;&lt;/p&gt;
&lt;p&gt;&lt;b&gt;Новая страница&lt;/b&gt;&lt;/p&gt;&lt;div&gt;==  By Value or By Reference ==&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;OL&amp;gt;&amp;lt;LI&amp;gt;Primitive variables are passed by value.&amp;lt;/LI&amp;gt;&amp;lt;LI&amp;gt;reference variables are passed by reference.&amp;lt;/LI&amp;gt;&amp;lt;LI&amp;gt;When you pass a primitive variable, the JVM will copy the value of the passed-in variable to a new local variable.&amp;lt;/LI&amp;gt;&amp;lt;LI&amp;gt;If you change the value of the local variable, the change will not affect the passed in primitive variable.&amp;lt;/LI&amp;gt;&amp;lt;LI&amp;gt;If you pass a reference variable, the local variable will refer to the same object as the passed in reference variable.&amp;lt;/LI&amp;gt;&amp;lt;LI&amp;gt;If you change the object referenced within your method, the change will also be reflected in the calling code.&amp;lt;/LI&amp;gt;&amp;lt;/OL&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
==  Passing objects to methods ==&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
   &lt;br /&gt;
  &amp;lt;!-- start source code --&amp;gt;&lt;br /&gt;
   &lt;br /&gt;
    &amp;lt;source lang=&amp;quot;java&amp;quot;&amp;gt;&lt;br /&gt;
class Letter {&lt;br /&gt;
  char c;&lt;br /&gt;
}&lt;br /&gt;
public class MainClass {&lt;br /&gt;
  static void f(Letter y) {&lt;br /&gt;
    y.c = &amp;quot;z&amp;quot;;&lt;br /&gt;
  }&lt;br /&gt;
  public static void main(String[] args) {&lt;br /&gt;
    Letter x = new Letter();&lt;br /&gt;
    x.c = &amp;quot;a&amp;quot;;&lt;br /&gt;
    System.out.println(&amp;quot;1: x.c: &amp;quot; + x.c);&lt;br /&gt;
    f(x);&lt;br /&gt;
    System.out.println(&amp;quot;2: x.c: &amp;quot; + x.c);&lt;br /&gt;
  }&lt;br /&gt;
}&amp;lt;/source&amp;gt;&lt;br /&gt;
    &lt;br /&gt;
   &lt;br /&gt;
  &amp;lt;!-- end source code --&amp;gt;&lt;br /&gt;
   &lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre class=codeResult&amp;gt;1: x.c: a&lt;br /&gt;
2: x.c: z&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
==  Reference Passing Test ==&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
   &lt;br /&gt;
  &amp;lt;!-- start source code --&amp;gt;&lt;br /&gt;
   &lt;br /&gt;
    &amp;lt;source lang=&amp;quot;java&amp;quot;&amp;gt;&lt;br /&gt;
class Point {&lt;br /&gt;
  public int x;&lt;br /&gt;
  public int y;&lt;br /&gt;
}&lt;br /&gt;
public class MainClass {&lt;br /&gt;
  public static void increment(int x) {&lt;br /&gt;
    x++;&lt;br /&gt;
  }&lt;br /&gt;
  public static void reset(Point point) {&lt;br /&gt;
    point.x = 0;&lt;br /&gt;
    point.y = 0;&lt;br /&gt;
  }&lt;br /&gt;
  public static void main(String[] args) {&lt;br /&gt;
    int a = 9;&lt;br /&gt;
    increment(a);&lt;br /&gt;
    System.out.println(a); // prints 9&lt;br /&gt;
    Point p = new Point();&lt;br /&gt;
    p.x = 400;&lt;br /&gt;
    p.y = 600;&lt;br /&gt;
    reset(p);&lt;br /&gt;
    System.out.println(p.x); // prints 0&lt;br /&gt;
  }&lt;br /&gt;
}&amp;lt;/source&amp;gt;&lt;br /&gt;
    &lt;br /&gt;
   &lt;br /&gt;
  &amp;lt;!-- end source code --&amp;gt;&lt;br /&gt;
   &lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre class=codeResult&amp;gt;9&lt;br /&gt;
0&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
==  Use an array to pass a variable number of arguments to a method. This is the old-style approach to variable-length arguments. ==&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
   &lt;br /&gt;
  &amp;lt;!-- start source code --&amp;gt;&lt;br /&gt;
   &lt;br /&gt;
    &amp;lt;source lang=&amp;quot;java&amp;quot;&amp;gt;&lt;br /&gt;
class PassArray {&lt;br /&gt;
  static void vaTest(int v[]) {&lt;br /&gt;
    System.out.print(&amp;quot;Number of args: &amp;quot; + v.length + &amp;quot; Contents: &amp;quot;);&lt;br /&gt;
    for (int x : v)&lt;br /&gt;
      System.out.print(x + &amp;quot; &amp;quot;);&lt;br /&gt;
    System.out.println();&lt;br /&gt;
  }&lt;br /&gt;
  public static void main(String args[]) {&lt;br /&gt;
    int n1[] = { 10 };&lt;br /&gt;
    int n2[] = { 1, 2, 3 };&lt;br /&gt;
    int n3[] = {};&lt;br /&gt;
    vaTest(n1); // 1 arg&lt;br /&gt;
    vaTest(n2); // 3 args&lt;br /&gt;
    vaTest(n3); // no args&lt;br /&gt;
  }&lt;br /&gt;
}&amp;lt;/source&amp;gt;&lt;br /&gt;
    &lt;br /&gt;
   &lt;br /&gt;
  &amp;lt;!-- end source code --&amp;gt;&lt;/div&gt;</summary>
			</entry>

	</feed>