08 2013 档案

摘要://递归的算法 private int fat(int b){ //递归的特点就是要找到出口 if(b == 2 || b == 1 ){ return 1; } return fat(b-1) + fat(b-2); } //迭代的方法 public static void ff(int index){ int a = 1; int b = 1; int c = 0; int i = 0; while(i < index ){ c = a + b; a = b; b = c; System.out.println(c); i ++ ; } } 阅读全文
posted @ 2013-08-28 10:04 lifeng_study 阅读(1110) 评论(0) 推荐(0) 编辑
摘要:面试中好多次都遇到这样的问题,今天终于搞懂了...class Test03 { public static void main(String[] args) { StringBuffer s = new StringBuffer("good"); StringBuffer s2 = new StringBuffer("bad"); test(s, s2); System.out.println(s);// goodhah System.out.println(s2);// bad } static void test(StringBuffer s, St 阅读全文
posted @ 2013-08-26 15:43 lifeng_study 阅读(296) 评论(0) 推荐(0) 编辑
摘要:package node;public class LNode { private int data; // 脚标 private LNode next;// 表示下一个节点 public int getData() { return data; } public void setData(int data) { this.data = data; } public LNode getNext() { return next; } public void setNext(LNode next) { ... 阅读全文
posted @ 2013-08-21 17:15 lifeng_study 阅读(247) 评论(0) 推荐(0) 编辑
摘要:例如:我有个账户表tb_account(账户表),用户信息表tb_user(用户表),在tb_account表中引用tb_user表的user_id最重要的部分在这里,对于实体bean的写法tb_account表对应的Account.java实体对象如下:private User user;@OneToOne(cascade = CascadeType.ALL) @JoinColumn(name="user_id",insertable=true,unique=true) public User getUser() { return user; } public void 阅读全文
posted @ 2013-08-09 17:29 lifeng_study 阅读(303) 评论(0) 推荐(0) 编辑

点击右上角即可分享
微信分享提示