您的位置:首页 > 编程语言 > Java开发

Java高职蓝桥杯校内选拔题

2016-12-27 12:04 127 查看
2、下面程序段的执行结果是【3】__12345____________

public
class
MyClass {
    int
a[] = { 1, 2, 3, 4,5 };
    void out()

    {   for (int j = 0; j <
a.length; j++)

           System.out.print(a[j] +
""); 
    }
    public
static void
main(String[] args) {
       MyClass my = new MyClass();

       my.out(); 
    }
}

源代码

public class test_two {

    int a[] = { 1, 2, 3, 4, 5 };
void out() 
{   
for (int j = 0; j < a.length; j++) 
System.out.print(a[j] + "");  

public static void main(String[] args) {
  test_two my = new test_two();
  my.out();
}

}
内容来自用户分享和网络整理,不保证内容的准确性,如有侵权内容,可联系管理员处理 点击这里给我发消息
标签: