![](https://img-blog.csdnimg.cn/20201014180756928.png?x-oss-process=image/resize,m_fixed,h_64,w_64)
java
Missgirlfalse
这个作者很懒,什么都没留下…
展开
-
二分查找法
import java.util.*;public class Demo07 {public static void main(String [] args){//给定一个数组String [] names ={"zhang","wang","li","zhao","sun","niu"};//输出该数组内容System.out.println(Arrays.toString(names));//原创 2015-01-08 20:22:43 · 330 阅读 · 0 评论 -
数组中取出重复
package quchuchongfu;import java.util.*;public class Demo01 {public static void main(String[] args) {//定义一个数组int [] pool = {1,2,2,3,4,5,5,6,9}; //输出该数组System.out.println(Arrays.toString(pool));//对数组中的原创 2015-01-03 15:01:46 · 725 阅读 · 0 评论 -
数组扩容
package shuzu;import java.util.*;public class Demo05 {public static void main(String []args){//定义一个数组int [] ary ={1,2,3,4,5};//扩容后的ary数组 ary = arryCopy(ary);//输出该数组System.out.println(Arrays.toString(a原创 2015-01-04 13:50:21 · 367 阅读 · 0 评论 -
数组复制
package shuzu;import java.util.Arrays;public class Demo04 {public static void main(String [] args){//定义一个数组int ary [] = {1,2,3,4,5,6};//输出该数组System.out.println(Arrays.toString(ar原创 2015-01-04 13:20:45 · 295 阅读 · 0 评论 -
冒泡,选择,插入
package shuzu;import java.util.Arrays;public class Demo02 {public static void main(String[] args) {//定义一个数组int [] ary = {1,2,3,3,2,4,5,5,4,3,2};//输出该数组System.out.println(Arrays.toString(ary));/** * 冒泡原创 2015-01-03 17:25:07 · 311 阅读 · 0 评论 -
猜字符游戏
public static char[] generate(int n){//创建字母表的字符数组char [] chs = {'A','B','C','D','E','F','G','H'};//标志位对应每一个字符boolean [] used = new boolean[chs.length];int i;//用来存放选中的字符的数组char [] answer = new char [n]原创 2015-01-01 14:41:50 · 574 阅读 · 0 评论 -
双色球
import java.util.Arrays;import java.util.Random;public class Ssq {public static void mian(String [] args){System.out.println("本期号码为:");gen();}/** * 实现选区双色球的方法 */public static String [] gen(){Random ra原创 2015-01-01 15:20:54 · 649 阅读 · 0 评论 -
交换两个数的三种方法
交换两个数原创 2014-12-11 12:13:44 · 559 阅读 · 0 评论 -
简单登录界面
简单登录界面原创 2014-12-25 10:38:30 · 402 阅读 · 0 评论 -
数组倒序
package shuzu;import java.util.*;public class Demo03 {public static void main(String[] args) {//定义两个数组int [] ary = new int[5];int [] ary1 = new int[5];//用户输入一个数组userInput(ary);//输出数组arySystem.out.prin原创 2015-01-04 11:22:05 · 563 阅读 · 0 评论