自定义博客皮肤VIP专享

*博客头图:

格式为PNG、JPG,宽度*高度大于1920*100像素,不超过2MB,主视觉建议放在右侧,请参照线上博客头图

请上传大于1920*100像素的图片!

博客底图:

图片格式为PNG、JPG,不超过1MB,可上下左右平铺至整个背景

栏目图:

图片格式为PNG、JPG,图片宽度*高度为300*38像素,不超过0.5MB

主标题颜色:

RGB颜色,例如:#AFAFAF

Hover:

RGB颜色,例如:#AFAFAF

副标题颜色:

RGB颜色,例如:#AFAFAF

自定义博客皮肤

-+
  • 博客(9)
  • 收藏
  • 关注

转载 eclipse中@override错误

有时候就爱钻牛角尖,今天在子类中重写接口中的方法,加上@override竟然错误,虽然不加也是正确的,但是就是看着不舒服,于是在网上查找了一下原来是jdk版本的问题,jdk5以前的版本@override不支持在子类中重写接口中的方法,jdk6就可以了,于是我修改了一下:Window——Preferences——java——Compiler——(Configure Project ...

2015-05-10 11:21:00 161

转载 比赛分组 功能描述:两个乒乓球队进行比赛,各出三人。 甲队为A、B、C三人,乙队为X、Y、Z 三人,已经抽签决定了比赛名单。 已知A 不和X 比,C 不和X、Z 比,请问...

当时看到题目的时候自己就晕了,不懂什么意思,做出来的结果竟然是一个人比好几个人,当时还觉得一个人可以打几场呢!==!后来求助大神得到了答案,共勉一下吧~~public static void main(String[] args) { for(int a = 1 ;a<=3;a++){ for(int b = 1 ;b<=3;b++){ for(...

2015-04-12 14:52:00 207

转载 输入一个五位正整数,使用数组判断它是不是回文数(例如12321是回文)

public static void main(String[] args) { Scanner scan = new Scanner(System.in); System.out.println("请输入一个五位正整数:"); int num = scan.nextInt(); String str = String.valueOf(num); char[] a = str....

2015-04-12 14:33:00 1304

转载 删除数组元素 功能描述:有一个有序整数数组,要求输入一个数字, 在数组中查找是否有这个数,如果有,将该数从数组中删除, 要求删除后的数组仍然保持有序;...

public static void main(String[] args) { int[] a={23,34,56,7,8,9}; int[] b = new int[a.length]; Scanner scan = new Scanner(System.in); System.out.println("请输入一个整数:"); int num = scan.nextInt(...

2015-04-12 14:32:00 2370

转载 将一个给定的整型数组转置输出(二维数组)

public static void main(String[] args) { int[][] a = new int[2][3]; int[][] b = new int[3][2]; int k = 1; System.out.println("转置前数组:"); for(int i = 0 ; i < 2 ; i++){ for(int j = 0 ; j &...

2015-04-12 14:26:00 897

转载 有一个已经排好序的数组。现输入一个数,要求按原来的规律将它插入数组中。...

public static void main(String[] args) { int[] a = {1,3,5,7,9,19,29,70}; int[] b = new int[a.length+1]; Scanner scan = new Scanner(System.in); System.out.print("请输入一个数:"); int insert = scan....

2015-04-12 14:21:00 265

转载 使用二重循环和break语句,找出2~100内所有的质数

public static void main(String[] args) { int m = 0; for(int i = 2 ; i < 100 ; i++){ for(int j = 2;j <= Math.sqrt(i)+1 ;j++){ m=i % j; if(m == 0){ break; } } if(m!=0...

2015-04-12 14:20:00 635

转载 使用多重循环打印6阶杨辉三角

public static void main(String[] args) { int[][] a = new int[6][]; //a[0][0] = 1; for(int i=0;i<6;i++){ a[i]=new int[i+1]; } for(int i = 0 ; i < 6 ; i++){ for(int j = 0 ; j &lt...

2015-04-12 14:19:00 109

转载 使用Arrays.copyOf()数组合并并排序

int[] a=new int[3]; int[] b=new int[3]; int[] c = new int[a.length+b.length]; c = Arrays.copyOf(a, c.length); /*arg0 - 源数组。 arg1 - 源数组中的起始位置。 arg2 - 目标数组。 arg3...

2015-04-12 13:13:00 228

空空如也

空空如也

TA创建的收藏夹 TA关注的收藏夹

TA关注的人

提示
确定要删除当前文章?
取消 删除