ak47947 发表于 2013-2-4 23:43:58

将数组传递给方法

<div style="padding-right: 5.4pt; padding-left: 5.4pt; background: #e6e6e6; padding-bottom: 4px; width: 95%; padding-top: 4px;">http://images.csdn.net/syntaxhighlighting/OutliningIndicators/None.gifpublicclassPassArrayElement
http://images.csdn.net/syntaxhighlighting/OutliningIndicators/ExpandedBlockStart.gifhttp://images.csdn.net/syntaxhighlighting/OutliningIndicators/ContractedBlock.gif...{
http://images.csdn.net/syntaxhighlighting/OutliningIndicators/InBlock.gifpublicstaticvoidmain(String[]args)
http://images.csdn.net/syntaxhighlighting/OutliningIndicators/ExpandedSubBlockStart.gifhttp://images.csdn.net/syntaxhighlighting/OutliningIndicators/ContractedSubBlock.gif...{
http://images.csdn.net/syntaxhighlighting/OutliningIndicators/ExpandedSubBlockStart.gifhttp://images.csdn.net/syntaxhighlighting/OutliningIndicators/ContractedSubBlock.gifint[]someNums=...{5,10,15,20};
http://images.csdn.net/syntaxhighlighting/OutliningIndicators/InBlock.gifintx;
http://images.csdn.net/syntaxhighlighting/OutliningIndicators/InBlock.giffor(x=0;x<4;++x)
http://images.csdn.net/syntaxhighlighting/OutliningIndicators/InBlock.gifSystem.out.println("Inmain"+someNums);
http://images.csdn.net/syntaxhighlighting/OutliningIndicators/InBlock.giffor(x=0;x<4;++x)
http://images.csdn.net/syntaxhighlighting/OutliningIndicators/InBlock.gifmethodGetsOneInt(someNums);
http://images.csdn.net/syntaxhighlighting/OutliningIndicators/InBlock.giffor(x=0;x<4;++x)
http://images.csdn.net/syntaxhighlighting/OutliningIndicators/InBlock.gifSystem.out.println("Atendofmain"+someNums);
http://images.csdn.net/syntaxhighlighting/OutliningIndicators/ExpandedSubBlockEnd.gif}
http://images.csdn.net/syntaxhighlighting/OutliningIndicators/InBlock.gifpublicstaticvoidmethodGetsOneInt(intone)
http://images.csdn.net/syntaxhighlighting/OutliningIndicators/ExpandedSubBlockStart.gifhttp://images.csdn.net/syntaxhighlighting/OutliningIndicators/ContractedSubBlock.gif...{
http://images.csdn.net/syntaxhighlighting/OutliningIndicators/InBlock.gifSystem.out.println("InmethodGetsOneInt"+one);
http://images.csdn.net/syntaxhighlighting/OutliningIndicators/InBlock.gifone=999;
http://images.csdn.net/syntaxhighlighting/OutliningIndicators/InBlock.gifSystem.out.println("Afterchange"+one);
http://images.csdn.net/syntaxhighlighting/OutliningIndicators/ExpandedSubBlockEnd.gif}
http://images.csdn.net/syntaxhighlighting/OutliningIndicators/ExpandedBlockEnd.gif}
页: [1]
查看完整版本: 将数组传递给方法