- 博客(27)
- 收藏
- 关注
原创 二叉树 基本概念
import java.util.Arrays;class Link{ private class Node{ private Node right; private Node left; private Comparable data; public Node(Comparable data){ th
2017-08-29 18:46:09
194
原创 Hello world输出2(函数输出)
import java.util.function.*;enum num{ Hello,world,}interface World{ public void print();}class Message extends Thread{ private String num; public Message(String num){ this.n
2017-08-22 19:44:15
1080
原创 hello world 的各种输出方式(1)闲的蛋疼
class Person{ private String name; public String getName() { return name; } public void setName(String name) { this.name = name; }}class Member{ private Member(){
2017-08-17 21:51:37
1606
原创 简单链表类(宠物商店模型)
interface ILink{}class Link implements ILink{ private class Node{ private Object data; private Node next; public Node(Object data){ this.data=data; }
2017-08-15 21:06:36
286
原创 简单链表练习
class A{ private class B{ private B next;//**节点** private Object data; public B(Object data){ this.data=data; } public void addB(B b){
2017-08-14 20:24:43
248
原创 递归算法求阶乘 和
public class factorail { public static void main(String args[]) { int sum=0; for (int counter = 0; counter <= 10; counter++){ System.out.println(counter+"!="+getNumbe
2017-08-07 14:04:56
996
原创 接口(简单概念)
//factory//工厂类interface IFruit{ public void eat();}class Factory{ public static IFruit getInstance(String className){ if("apple".equals(className)){ return new Apple();
2017-07-31 20:15:47
153
原创 简单(自动猜数字)
class Player{ int number; public void guess(){ number=(int)(Math.random()*100); System.out.println("我猜是"+number); }}class GuessGame{ Player p1; Player p2; Play
2017-07-27 15:19:15
729
原创 数组操作(进阶)
class Array{ private int data[]; private int foot=0; public Array(int len){//设置数组长度 if(len>0){ this.data=new int[len]; }else{ this.data=new int[1];
2017-07-26 10:42:50
227
原创 java继承基本概念练习
class Person1{ private String name; public void setName(String name){ this.name=name; } public String getName(){ return this.name; } public Person1(){ System
2017-07-20 19:26:22
285
原创 内部类概念简单练习
package 内部类;class Outer{ private String msg="hello word!"; private class Inner{//private 定义的内部类不能程序外部直接调用 public void print(){ System.out.println(msg);//Out。this
2017-07-18 22:20:27
223
原创 static关键字简单应用
//自动命名+简单计数class Person1{ private String name; private static int count; public Person1(){ this("name="+ ++count); System.out.println(count); } public Person1(Strin
2017-07-17 19:05:37
145
原创 简单类(练习3)部门,雇员,职位,权限
class Dept{//部门信息 private int did; private String dname; private Emp[] emps; private Role role; public Dept(int did,String dname){ this.did=did; this.dname=dname;
2017-07-16 18:13:57
297
原创 简单类(多对多练习)
class Student{ private int id; private String name; private Studentcourse[] studentcourse; public Student(){ } public Student(int id,String name){ this.id=id; thi
2017-07-15 19:02:29
283
原创 简单类(进阶)
package javac;class Dept{ private String name; private String num; private Emp[] emps; private Emp mgr; public void setName(String name){ this.name=name; } public S
2017-07-14 17:27:02
168
原创 简单应用传递练习
package yingyongchuandi;class Text{ private String name; private int age; private Data data; private Text text1; public Text(String name,int age){ this.name=name; th
2017-07-13 19:53:48
214
原创 String首字母大写操作
package String; //首字母大写操作 public class initcap { public static void main(String args[]){ String data=”helloworld”; System.out.println(initcap(data)); System.out.printl
2017-07-09 20:21:44
291
原创 String 类------字符串转字符数组判断字符串中是否含有字母
//toCharArray()public class Array{ //判断数组是全否由数字组成 public static void main(String args[]){ String data="a123456"; char[] arr=data.toCharArray(); for(int x=0;x<arr.length
2017-07-06 12:46:30
462
原创 简单数组查找
public class Array{ public static void main(String args[]){ int data[]=new int[]{ 1,2,3 }; int search=2; System.out.print(search(data,search)); } pu
2017-07-02 21:14:59
165
原创 数组进阶对象数组
class Student{private String id;private String name;private int grade;public String getId() { return id;}public void setId(String id) { this.id = id;}public String getName() { retur
2017-07-02 21:12:44
188
原创 二维数组置换
public class Array { public static void main(String args[]){ int data[][]= new int [][]{{1,2,3},{4,5,6},{7,8,9}}; sort(data); printArray(data); } public static void sort(int arr[
2017-07-02 11:42:22
379
原创 数组进阶-数组倒置
public class Array { public static void main(String args[]){ int data[]= new int []{1,5,3,4,2,7,9,8}; sort(data); printArray(data); } public static void sort(int arr[]){
2017-07-02 10:04:18
273
原创 数组进阶找出最大或最小值
public class Array { public static void main(String args[]){ int dataA[]= new int []{1,2,3,4,5,7,8,9}; int max=dataA[0]; int min=dataA[0]; printArray(dataA); for(int y=1;y<dataA.
2017-07-01 13:27:30
203
原创 for循环 进阶练习
//菱形public class Tuxing{ public static void main(String arg[]){ for(int x=1;x<=3;x++){ for(int y=4;y>=x;--y){ System.out.print(" "); }
2017-06-30 19:02:22
294
原创 简单数组练习
//完整的静态初始化数组public class Array { public static void main(String args[]){ String name[]=new String[]{"10","20"};// System.out.println(name.length); for(int x=0;x<=name.length
2017-06-30 13:22:23
200
原创 for语句的简单练习 打印三角 九九乘法表 累加
//for语句的简单练习//九九乘法表public class Text{ public static void main(String arg[]){ for(int x=1;x<=9;x++){ for(int y=1;y<=x;y++){ System.out.print(x+"*"+y+"="+x*y+" ");
2017-06-30 10:58:35
629
原创 3个简单类练习
代码块//学生类class Student{ private String name; private int sno; private int age; private int grade; private int englishscore; private int sex; public Student(){ } publi
2017-06-29 20:47:34
436
空空如也
空空如也
TA创建的收藏夹 TA关注的收藏夹
TA关注的人