- 博客(11)
- 收藏
- 关注
转载 单例设计模式 Singleton
1 class Singleton{ 2 private static final Singleton INSTANCE=new Singleton(); 3 private Singleton (){} //构造方法私有化 4 public static Singleton getInstance(){ 5 return IN...
2016-10-09 15:20:00
79
转载 代理设计模式
1 interface A 2 {public void get(); 3 } 4 class B implements A 5 {public void get(){ 6 System.out.println("出席活动"); 7 } 8 } 9 class C implements A10 {private A a;11 pub...
2016-09-27 17:26:00
60
转载 工厂设计模式
1 interface A 2 {public void fintr(); 3 } 4 class B implements A 5 {public void fintr(){ 6 System.out.println("666"); 7 } 8 } 9 class C implements A10 {public void fint...
2016-09-27 17:10:00
93
转载 抽象类的定义与使用
1 abstract class Action { 2 public static final int ECT=1; 3 public static final int WROLD=2; 4 public static final int Sleep=7; 5 public void cmmand(int fag){ 6 switch (fag)...
2016-09-24 15:42:00
89
转载 Java类(多项1对多映射)
1 class Province { 2 private int pid; 3 private String name; 4 private Stata stata; 5 private City citys [] ; 6 public void setStata(Stata stata){ 7 ...
2016-09-15 17:13:00
101
转载 Java类(1对多)
1 class Province { 2 private int pid; 3 private String name; 4 private City citys [] ; 5 public void setCitys(City citys[]){ 6 this.citys=citys; 7 }...
2016-09-15 10:50:00
78
转载 简单Java类深入
①实现基本字段的转换:class Emp { private String ename; private int empno; private double sal; private double comm; private String job; //set.get略 public Emp() {} public Emp(String ename,int empno,do...
2016-09-12 22:01:00
76
转载 this关键字
class emp{private int empno ; private String ename; private String job ; private double sal ; public emp(){ this(1,"张三","前台",100); } public emp (int empno){ this(empno,"...
2016-09-08 17:44:00
65
转载 String常用方法
public class first{public static void main(String args[]){ String asd = "helloworld"; String asf = "hello world love"; System.out.println(asd.contains("hello"));//判断“hello”是否存在...
2016-09-07 19:55:00
76
转载 测试
//public class Stringdemo//{public static void main (String args[]){// String ste="hello";// char st = ste.charAt(0);//取出指定索引的字符// System.out.println(st);// }//}/* public c...
2016-09-01 18:06:00
63
转载 String类的基本概念
2016-08-30 19:53:55(1.1)请解释在字符串相等的判断中"=="与"equals()"的区别 · "=="是java提供的关系运算符,主要功能是进行数值相等的判断,如果在String对象上表示的是内存地址数值的比较; · "equals()" 是由String提供的一个方法,此方法专门负责进行字符串内容的比较。 1...
2016-08-30 20:09:00
70
空空如也
空空如也
TA创建的收藏夹 TA关注的收藏夹
TA关注的人
RSS订阅