08 2013 档案
摘要:interface InfoPerson{ }class Contact implements InfoPerson{ private String address; private String telphone; private String zipcode; public Contact (S...
阅读全文
摘要:interface InfoPerson{}class Contact implements InfoPerson{private String address;private String telphone;private String zipcode;public Contact (String...
阅读全文
摘要:class InfoDemo {private T var;private V value;public InfoDemo(T var, V value){this.setvalue(value);this.setvar(var);}public void setvar(T var){this.va...
阅读全文
摘要:class InfoDemo { private T var; private V value; public InfoDemo(T var, V value){ this.setvalue(value); this.setvar(var); } public void setvar(T var...
阅读全文
摘要:当我们在编程的时候经常会用到传递,当传递过程中有多种数据类型的时候,我们可以采用通配符来解决这样的问题。下面的程序中的fun方法中 可以接收任何类型的泛型类型,那么在传递的过程中就不用担心数据传递异常的情况。class Info{private T var;public void setName(T...
阅读全文
摘要:当我们在编程的时候经常会用到传递,当传递过程中有多种数据类型的时候,我们可以采用通配符来解决这样的问题。下面的程序中的fun方法中 可以接收任何类型的泛型类型,那么在传递的过程中就不用担心数据传递异常的情况。class Info{ private T var; public void setName...
阅读全文
摘要:如果在程序设计的过程中出现了多个数据类型,那么就可以考虑使用泛型来指定相应的操作。程序比较:class Point{private Object name;private Object year; public void setName(Object name,Object year){this.n...
阅读全文
摘要:如果在程序设计的过程中出现了多个数据类型,那么就可以考虑使用泛型来指定相应的操作。程序比较:class Point{ private Object name; private Object year; public void setName(Object name,Object year){ t...
阅读全文
摘要:中文API,英文API都带索引,方便初学者进行学习:http://pan.baidu.com/share/link?shareid=3001658266&uk=4079471022jdk1.7版本下载http://pan.baidu.com/share/link?shareid=3012622533...
阅读全文
摘要:中文API,英文API都带索引,方便初学者进行学习: http://pan.baidu.com/share/link?shareid=3001658266&uk=4079471022 jdk1.7版本下载http://pan.baidu.com/share/link?shareid=3012622...
阅读全文
摘要:class Threadlife implements Runnable{private boolean flag = true;//定义标志位public void run(){int i=0;while(flag){System.out.println("i = " + i++);}}publi...
阅读全文
摘要:class Threadlife implements Runnable{ private boolean flag = true; //定义标志位 public void run(){ int i=0; while(flag){ System.out.println("i = " + i+...
阅读全文
摘要:以卖车票为例:class SyThread implements Runnable{private int ticket = 5;@Override public void run() {//for(int i=5; i>0; i--)for(int i=0; i 0){try {Thread.sl...
阅读全文
摘要:以卖车票为例:class SyThread implements Runnable{ private int ticket = 5; @Override public void run() { //for(int i=5; i>0; i--) for(int i=0; i 0){ tr...
阅读全文
摘要:Thread类的实现class MyThread extends Thread{private int time;public MyThread (String name,int time){ //设置线程的名称和休眠时间;super(name);//得到线程的名称this.time = time;...
阅读全文
摘要:Thread类的实现class MyThread extends Thread{ private int time; public MyThread (String name,int time){ //设置线程的名称和休眠时间; super(name); //得到线程的名称 this.ti...
阅读全文

浙公网安备 33010602011771号