10年03月

1.读SpringGuide,里面所有sample写一遍。6号之前看完

2.面试题目,多多益善。

3.坚持写计划,不写出来,老是晃悠,这看看那看看,没有一个明确的目标,时间就这样浪费过去了。每周两次写计划。

 

-----------------------------------------

 

今天去面试,赶紧写个心得。

 

有几个题目不会做,菜鸟,大家别笑话。

1.遍历c:\temp下所有的文件(包括所有子文件夹中的文件),如果是txt文本,记录绝对路径。然后输出所有的绝对路径。(主要是考递归,怎么递归不知道,算法题很少研究,以后得补上)

2.SQL的case用法 和 一个table,求每月营业额增长率(当月减去上个月的差除以上月营业额,第一个月是0,只有一年1-12月)

3.某国硬币有15,23,29,41,67五种硬币(单位是分),有多少种组合可以组成1808分,硬币用不完(以前也看过类似的帖子,只看不写,眼高手低啊!写一遍就有印象了)

 

 

还有一些会做,但是感觉没写好,不够准确的,记录下

 

4.hibernate 查询数据库的集中方式,说说各自的特点,映射关系,级联操作

http://yangzhibin-java.iteye.com/blog/446429

5.倒序输出一个文本文件中的所有内容

6.接口,抽象类。写的比较乱。这个比较好,详细,这些应该会背

http://iamnk2008.iteye.com/blog/364015

 

还有其他题目都是很常见的

 

package TestMianShi;

import java.io.File;
import java.util.LinkedList;

public class ListAllTxtFile {

	/**
	 * @param args
	 */
	public static void main(String[] args) {
		// TODO Auto-generated method stub
		File f_temp = new File("F:\\temp\\test");
		LinkedList<String> ll = new LinkedList<String>();
		listDirectoryFile(f_temp,ll);
		for(String path:ll){
			System.out.println(path);
		}
	}
	
	static void listDirectoryFile(File f , LinkedList<String> ll){
		if(f.isDirectory()){
			File[] temp_files = f.listFiles();
			for(int i=0;i<temp_files.length;i++){
				listDirectoryFile(temp_files[i] , ll);
			}
		}else if(f.isFile()&&f.getName().endsWith(".txt")){
			ll.add(f.getAbsolutePath());
		}/*else{
			return;
		}*/
	}
}

 

最后的return要不得。其实好好想一下,还是可以做出来的。可是笔试的时候可没有debug

 

2.

select id, case name when name='Emma' then 'hi,Emma' when name='Tom' then 'hi,Tom' end from user

 

select t1.month '月份', t1.value/t2.value - 1 as '增长率' from market t1 left join market t2 on t1.month = t2.month + 1

 

3.

	public static void main(String[] args) {
		Stack<Integer> roots =new Stack<Integer>();
		int[] coins = {1,5,10,25};
		divide(6,coins,roots);
	}
	
	private static void divide(int num,int[] coins,Stack<Integer> roots){
        for (int coin : coins){
            if (num - coin >=0 && (roots.size()==0 || coin <= roots.get(roots.size()-1))){
                roots.push(new Integer(coin));
                if (num - coin > 0){
                    divide (num - coin,coins,roots);
                } else {    // Get one
                    for (Integer root: roots){
                        System.out.print (root);
                        System.out.print (" ");
                    }
                    System.out.print ("\n");
                }
                roots.pop();
            }
        }
    }
  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值