morgenstanly's written exam

subject topic:
1, hashMap ,
HashMap hasmap = new HashMap();
hasmap.put("1","one");
hasmap.put("2","two");
hasmap.put("3","three");
....
hasmap.put("100","one hundred");

how to remove all items in hasmap whose key is less than 100?

answer:

for(Iteroter i = hashmap.keySet().iterator();it.hasNext();){
Object o = i.next();
int key = (int) o;
...
}
Iterator i = hashmap.EntrySet().iterator();
while(i.hasNext()){
Map.Entry<int, String> e = i.next();
int key = e.getKey();
...
}


2,what's the purpose of finalization?

The purpose of finalization is to give an unreachable object the opportunity to perform any cleanup processing before the object is garbage collected. For example, closing a opened file, closing a opened database Connection.

3,what's the difference between box and unboxing in c#?

Boxing refers to a conversion from a non-nullable-value type to a reference type or conversion from a non-nullable-value type to some interface it implement.For example:
int i = 2;
Object o = i
Unboxing refers to a explicit conversion from a value type or Object type to a non-nullable type, or from some interface to non-nullable type.For example:
Object o = (int) 5;
int i = (int) o;
4,what is singleton design pattern?
singletion pattern is to resrict instantiation a class to only one object. It's useful when it only needs one object to coordinate the system. In singleton pattern, there just one oject of the class, and only the class itself could create oject.

5,what is the diference between static variance and global variance?
static variance is initialize once when it come into the program, if it's a static variance in a funtion, it's local variance, it only could be seen in the function; if it's a static variance in class, it could be share by all objects of the class.
Global variance could be seen by all in the program, not just in one function and one class.

6, what's stored procedure, and how to use?
Stored procedure is a subroutine available for applications to access rational database system. Stored procedures are actuall stored in database data dictionary.
It is use by call statement or execute statement:
call procedure(parameters);
execute procedure(parameters);

7,what's the differences between clustered index and non-clustered inedex?


8,what's heap and stack, and what's their differences? what goese on them?

multichoice:
1, stable and unstable algorithm?

2, A method repeatedly call itselt, what's it ?
A, Iterative, B,Recursive,C,Discursive, D,Looping

3, String A,B,C A= new... , B+A;C=A+B, how many object have been created?

4,wait, sleep, notify, lock ?

5, Mutex, AutoResetEvent, ManulResetEvent in .Net
6, new Myobject[100];
  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值