一. 简单实例 类名 操作 数据 1. 类 public class Name { // Name 为类名 private String data ; // data为数据 public void operation() {} // operation()为操作 } 2.实例化 对象 ---> 类 在Java中,就是new操作,此时会使对象内部的数据分配存储空间. 3. 继承关系 public class ParentClass { public void s ...
1 树与哈夫曼树 package tree; public class TreeNode { TreeNode llink; TreeNode rlink; int info; } package tree; public class Tree { TreeNode root; public Tree() { } public boolean isEmpty() { return roo ...
排序的java实现: import java.util.*; public class BubbleSort{ public void sort(int[] a){ for(int i=0;i for(int j=a.length-1;j>=i+1;j--){ if(a[j] int tmp =a[j]; a[j]=a[j-1]; a[j-1]=tmp; } } } } public static void main(String[] args){ int[] a = {1,6,3,8,1,56,}; BubbleSort bs = new BubbleSort ...
package Collection; import java.util.*; public class Sort { private static ArrayList list = new ArrayList(); private static UserBean[] user = new UserBean[4]; public static void main(String[] args) { Sort sort = new Sort(); user[0] = new UserBean("004",34); user[1] = new UserBe ...
BEA
搜索本博客
我的相册
C185a0b8-90cb-37ce-9140-04449c6497bf-thumb
427531f9-950e-4e4d-88b6-8d1ef3df545f
共 88 张
存档
最新评论