📄 tsld024.htm
字号:
<HTML>
<HEAD>
<META HTTP-EQUIV="Context-Type" CONTEXT="text/html;charset=windows-1252">
<meta name="GENERATOR" content="Microsoft Internet Assistant for PowerPoint 97">
<TITLE>Example Passing Arguments</TITLE>
</HEAD>
<BODY >
<H1>Example Passing Arguments</H1>
<P><UL>
public class PassingArguments {
<BR></UL><UL>
</UL><UL>
public void test(int x, int y, int[] array) {
</UL><UL>
x=1; y=2; array[0] = 5;
</UL><UL>
System.out.println("inside test method x:" + x + " y:" + y +
</UL><UL>
" array[0]:" +array[0] );
</UL><UL>
}
</UL><UL>
public static void main(String[] argv) {
</UL><UL>
int a = 5; int b = 10 ;
</UL><UL>
int[] ar = {15 };
</UL><UL>
</UL><UL>
System.out.println("Before the test call a:" + a + " b:" + b + " ar[0]:" +ar[0]);
</UL><UL>
PassingArguments pa = new PassingArguments();
</UL><UL>
pa.test(a,b, ar);
</UL><UL>
System.out.println("After the test call a:" + a + " b:" + b + " ar[0]:" +ar[0]);
</UL><UL>
}
</UL><UL>
}</UL></P>
<P><UL>
Before the test call a:5 b:10 ar[0]:15
<BR></UL><UL>
inside test method x:1 y:2 array[0]:5
</UL><UL>
After the test call a:5 b:10 ar[0]:5</UL></P>
<P></P>
<P>
<TABLE>
<TD HEIGHT=100 WIDTH=100> <A HREF="tsld023.htm">Previous slide</A> </TD>
<TD HEIGHT=100 WIDTH=100> <A HREF="tsld025.htm">Next slide</A> </TD>
<TD HEIGHT=100 WIDTH=150> <A HREF="tsld001.htm">Back to first slide</A> </TD>
<TD HEIGHT=100 WIDTH=150> <A HREF="sld024.htm">View graphic version</A> </TD>
</TABLE>
<BR>
</P>
</Body>
</HTML>
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -