首页 > 编程语言 > 详细

JAVA问题总结之15-多个类之间的调用

时间:2015-08-27 13:31:33      阅读:209      评论:0      收藏:0      [点我收藏+]

JAVA问题总结之15-多个类之间的调用:

代码:

package java3;

public class test1 {
	public static void main(String[] args){
		Pretimive t = new Pretimive();
		for (int i=0;i<t.b.length;i++){
			System.out.println(t.b[i]);
		}
		System.out.print("\n");
		t.b[0]=true;
		t.b[2]=true;
		for (int i=0;i<t.b.length;i++){
			System.out.println(t.b[i]);
		}
		System.out.print("\n");
		
		
		int_10 i1=new int_10();
		for (int i=0;i<i1.b.length;i++){
			System.out.println(i1.b[i]);
			i1.b[i]=i;
		}
		System.out.print("\n");
		for (int i=0;i<i1.b.length;i++){
			System.out.println(i1.b[i]);
//			i1.b[i]=i;
		}
		
	}
}

class Pretimive{
	boolean[] b=new boolean[3];
}
class int_10{
	int[] b=new int[10];
}

结果:

false
false
false

true
false
true

0
0
0
0
0
0
0
0
0
0

0
1
2
3
4
5
6
7
8
9



版权声明:本文为博主原创文章,未经博主允许不得转载。

JAVA问题总结之15-多个类之间的调用

原文:http://blog.csdn.net/xubo245/article/details/48024283

(0)
(0)
   
举报
评论 一句话评论(0
关于我们 - 联系我们 - 留言反馈 - 联系我们:wmxa8@hotmail.com
© 2014 bubuko.com 版权所有
打开技术之扣,分享程序人生!