- 博客(13)
- 收藏
- 关注
原创 二分查找法
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
332
原创 game猜数字游戏
import java.awt.*;import java.awt.event.ActionEvent;import java.awt.event.ActionListener;import java.util.*;import javax.swing.*;public class gamecaishuzi extends JFrame implements ActionListener{/**
2015-01-04 23:00:13
394
原创 数组扩容
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
371
原创 数组复制
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
296
原创 数组倒序
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
566
原创 冒泡,选择,插入
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
315
原创 数组中取出重复
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
730
原创 双色球
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
654
原创 猜字符游戏
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
579
原创 数组学生管理
package arrayStudent;import java.util.Scanner;public class StudentManageSystem {public static void main(String[] args) {//导入扫描仪Scanner in = new Scanner(System.in);//提示信息System.out.println("请输入学生的人数:")
2014-12-27 13:17:30
300
原创 售票同步锁
要求:实现多窗口售票机制public class Ticket { /** * 售票员卖票问题 */ public static void main(String[] args) { //实例化该窗口类的对象 TicketWindow tw = new TicketWindow(); //将该对象放入三个线程 Thread t1 = new Th
2014-12-22 11:47:02
434
空空如也
空空如也
TA创建的收藏夹 TA关注的收藏夹
TA关注的人