![](https://img-blog.csdnimg.cn/20201014180756927.png?x-oss-process=image/resize,m_fixed,h_64,w_64)
java习题
无
半皖丨清愁
这个作者很懒,什么都没留下…
展开
-
java基础之包装类面试题
import org.junit.Test; public class InterviewTest { @Test public void test1() { Object o1 = true ? new Integer(1) : new Double(2.0); System.out.println(o1);// } @Test public void test2() { Object o2; if (true) o2 = new Integer(1); else原创 2020-12-05 17:59:32 · 102 阅读 · 1 评论 -
冒泡排序
package com.yao.sort; /* * 实现数组的冒泡排序 */ public class BubbleSortTest { public static void main(String[] args) { // TODO Auto-generated method stub int[] arr = new int[] {-23,25,64,0,83,-53,29,125}; //冒泡排序 for(int i = 0;i < arr.length-1;i++){.原创 2020-11-07 15:13:09 · 36 阅读 · 0 评论 -
线性查找与二分查找
package com.yao.exer; /* * 数组复制反转遍历 * 线性查找 * 二分查找 */ public class ArrayExer6 { public static void main(String[] args) { // TODO Auto-generated method stub String[] arr = new String[] {"JJ","DD","BB","AA","PP","QQ"}; //数 组的复制 String[] arr1 = n原创 2020-11-07 14:09:30 · 98 阅读 · 0 评论 -
杨辉三角
package com.yao.exer; /*杨辉三角 1 1 1 1 2 1 1 3 3 1 1 4 6 4 1 1 5 10 10 5 1 1 6 15 20 15 6 1 1 7 21 35 35 21 7 1 1 8 28 56 70 56 28 8 1 1 9 36 84 126 126 84 36 9 1 * */ public class YangHuiTriangle { public static void main(String[]原创 2020-11-07 13:44:18 · 63 阅读 · 0 评论 -
回形数
package com.yao.exer; import java.util.Scanner; /* 1 2 3 4 12 13 14 5 11 16 15 6 10 9 8 7 */ public class ArrayExer3 { public static void main(String[] args) { int j = 0;//列 int i = 0;//行 Scanner scan = new Scanner(System.i原创 2020-11-07 13:43:11 · 79 阅读 · 0 评论