微店

一、笔试

1.Object类的方 法

equals hashCode  toString wait  notify  notifyAll

2.内存泄漏的例子

静态集合类引起内存泄露、当集合里面的对象属性被修改后,再调用remove()方法时不起作用

监听器 、各种连接 、内部类和外部模块等的引用 、单例模式

3.代码

package test;

public class Test {

	public static void main(String[] args) {
		String str1="abc";
		String str2=new String("abc");
		String str3="a"+"bc";
		System.out.println(str1==str2);
		System.out.println(str2==str3);
		System.out.println(str1==str3);
		System.out.println("------------------");
		Integer i1=10;
		Integer i2=Integer.valueOf(10);
		Integer i3=new Integer(10);
		System.out.println(i1==i2);
		System.out.println(i2==i3);
		System.out.println(i1==i3);
		

	}

}

false
false
true
------------------
true
false
false

4.split实现

package test;

import java.util.ArrayList;
import java.util.List;

public class Split {
	public static String [] split(String str,char c){
		List<String> list=new ArrayList<String>();
		StringBuffer strBuf=new StringBuffer();
		for(int i=0;i<str.length();i++){
			if(str.charAt(i)!=c)strBuf.append(str.charAt(i));
			else if(str.charAt(i)==c && strBuf.length()>0){
				list.add(strBuf.toString());
				strBuf=new StringBuffer();
			}
		}
		String[] array =new String[list.size()];
		return list.toArray(array);
	}

	public static void main(String[] args) {
		String str="abbbsbsdfbsdfsadfbsdfadsfbb";
		String []result=split(str,'b');
		for (int i = 0; i < result.length; i++) {
			System.out.println(result[i]);
		}
	}
}

5.质数判断


6.日志分析系统设计


  • 0
    点赞
  • 1
    收藏
    觉得还不错? 一键收藏
  • 0
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值