2012年3月23日
#
摘要: 此法則適合所有語(yǔ)言,咱們以JavaScript和Java兩個(gè)角度分析一下這個(gè)東東。 一、javascript 有這樣的一個(gè)頁(yè)面,js、css代碼都寫(xiě)在html頁(yè)面中。 例如:gnj.html v1版本Code highlighting produced by Actipro CodeHighlighter (freeware)http://www.CodeHighlighter.com/-...
閱讀全文
一、列與行的參數(shù)都由三個(gè)部分組成:對(duì)齊方式、固定尺寸、調(diào)整方式。
1.對(duì)齊方式:
1)列對(duì)齊有l(wèi)eft, center, right, fill.默認(rèn)fill
2)行對(duì)齊有:top, center, bottom, fill. 其中fill表示填充至整個(gè)區(qū)域。默認(rèn)center。
2.固定尺寸:
pref表示preferred size,適當(dāng)大小,即首選尺寸大小。
min表示minimum size,
dlu 表示dialog units,
px, pt, in, mm, cm)分別表示Pixel, Points, Inches, Millimeter, Centimeter。
3. 調(diào)整方式:
二、CellConstraints:
cc.xywh(3, 1, 3, 1):表示3列,1行,colspan=3,rowspan=1
三、FormLayout:
1.FormLayout layout = new FormLayout(
new ColumnSpec[]{
FormSpecs.DEFAULT_COLSPEC,
FormSpecs.GLUE_COLSPEC,
FormSpecs.DEFAULT_COLSPEC,
FormSpecs.GLUE_COLSPEC,
FormSpecs.DEFAULT_COLSPEC,
FormSpecs.GLUE_COLSPEC},
new RowSpec[]{
FormSpecs.DEFAULT_ROWSPEC,
FormSpecs.GLUE_ROWSPEC,
FormSpecs.DEFAULT_ROWSPEC,
FormSpecs.GLUE_ROWSPEC,
FormSpecs.DEFAULT_ROWSPEC,
FormSpecs.GLUE_ROWSPEC
}
);
2.
FormLayout layout = new FormLayout(
"right:pref, 6dlu, 50dlu, 4dlu, center:50dlu", // columns
"pref, 3dlu, pref, 3dlu, pref"); // rows
參考文章:
http://hi.baidu.com/lijunwyf/item/a18d95f719ff01da6225d26f
例子:
import java.util.*;
public class TestVector{
public static void main(String[] args){
Vector v = new Vector();
v.add(null);
v.add(new Integer(1));
v.add("123");
for(Enumeration e = v.elements();e.hasMoreElements();){
System.out.println(e.nextElement());
}
v.insertElementAt("insert",2);
v.setElementAt("insert",0);
for(Enumeration e = v.elements();e.hasMoreElements();){
System.out.println(e.nextElement());
}
}
}
結(jié)果:
null
1
123
insert
1
insert
123
結(jié)論:
vector中可以放入null;
vector可以放入不同類(lèi)型的對(duì)象;
vector是同步的容量自增長(zhǎng)的向量;
一、前提須知:
1.北京鐵路局:
直屬站15個(gè):
北京站、
北京西站、
天津站、
天津西站、
豐臺(tái)站、
豐臺(tái)西站、
南倉(cāng)站、
塘沽站、
唐山站、
石家莊站、
石家莊南站、邯鄲站、
陽(yáng)泉站、北京南站、天津西站。
2.鄭州鐵路局:
直屬車(chē)站11個(gè):
鄭州站、鄭州北站、鄭州東站、洛陽(yáng)站、
新鄉(xiāng)站、開(kāi)封站、商丘站、
月山站、長(zhǎng)治北站、長(zhǎng)治站。
二、
北京電話訂票竅門(mén):1、座機(jī)打!;2.用手機(jī)加區(qū)號(hào)打!北京鐵路局管內(nèi),如唐山區(qū)號(hào):打0315-95105105,手機(jī)打95105105的有效區(qū)號(hào):河北省邯鄲0310石家莊0311保定0312張家口0313承德0314唐山0315廊坊0316滄州0317衡水0318邢臺(tái)0319秦皇島0335山東德州0534山西陽(yáng)泉0353天津022。訂好之后可以在北京取票!!
ERROR - Exception executing batch:
org.hibernate.StaleStateException: Batch update returned unexpected row count fr
om update [0]; actual row count: 0; expected: 1
ERROR - Could not synchronize database state with session
org.hibernate.StaleStateException: Batch update returned unexpected row count fr
現(xiàn)象:
頁(yè)面報(bào)500.
原因:
在request.getRequestDispatcher("/success.html").forward(request, response);
后面還有未執(zhí)行的代碼,但是已經(jīng)提交了響應(yīng)。
1.UML:unified modeling Language(統(tǒng)一建模語(yǔ)言)
2.草圖與藍(lán)圖:
前者指:手工繪制的、規(guī)范度較低的UML模型;
后者指:case工具繪制的正式的、規(guī)范的UML模型;
3.不同可視性的符號(hào):
“+”:public “#”:protected “-”:private “~”:package
4.UML主要包含三種圖:靜態(tài)圖、動(dòng)態(tài)圖、物理圖
5.關(guān)聯(lián)關(guān)系:用來(lái)表示一個(gè)對(duì)象持有另外一個(gè)對(duì)象的引用,或是調(diào)用另外一個(gè)對(duì)象的方法
6.類(lèi)圖:
圖.png)
7.類(lèi)圖之間的關(guān)聯(lián):
—▷▷ —>持有
只有注冊(cè)用戶(hù)登錄后才能閱讀該文。
閱讀全文
1.public class TestKnowleage5 {
public static void main(String[] args){
String strValue = "ABCDEFG";
strValue.substring(3);
System.out.println("result1"+strValue);
strValue.concat("123");
System.out.println("result2"+strValue);
String value = new String("ABCDEFG");
System.out.println(strValue==value);
}
}
運(yùn)行結(jié)果:
result1ABCDEFG
result2ABCDEFG
false
2.public class Test{
public static void main(String[] args){
int x = 100;
int y = 200;
if(x == y)
System.out.println("not equal");
else
System.out.println("equal");
}
}
運(yùn)行結(jié)果:
equal
3.public class TestKnowleage5 {
public static void main(String[] args){
try{
new TestKnowleage5().methodA(5);
}catch(IOException e){
System.out.println("caught IOException");
}catch(Exception e){
System.out.println("caught Exception");
}finally{
System.out.println("no Exception");
}
}
public void methodA(int i) throws IOException{
if(i%2 != 0){
throw new IOException("methodA IOException");
}
}
}
運(yùn)行結(jié)果:
caught IOException
no Exception
4.public class TestKnowleage5 {
static boolean isTrue(){
System.out.println("isTrue");
return true;
}
static boolean isFalse(){
System.out.println("isFalse");
return false;
}
public static void main(String[] args){
if(isTrue() || isFalse()){
System.out.println("|| operate return true");
}
if(isFalse() & isTrue()){
System.out.println("& operate return true");
}
}
}
運(yùn)行結(jié)果:
isTrue
|| operate return true
isFalse
isTrue
5.public class TestKnowleage5{
public static void main(String args[]){
MyThread t = new MyThread();
t.run();
t.start();
System.out.println("A");
}
}
class MyThread extends Thread{
public void run(){
try{
Thread.currentThread().sleep(3000);
}catch(InterruptedException e){
}
System.out.println("B");
}
}
運(yùn)行結(jié)果:
BBA或
BAB
6.class A{
void fun1(){
System.out.println(fun2());
}
int fun2(){
return 123;
}
}
public class TestKnowleage5 extends A{
int fun2(){
return 456;
}
public static void main(String[] args){
A a;
TestKnowleage5 b = new TestKnowleage5();
b.fun1();
a = b;
a.fun1();
}
}
運(yùn)行結(jié)果:
7.class A{
int val;
public int getVal() {
return val;
}
public void setVal(int val) {
this.val = val;
}
}
public class TestKnowleage5{
public static void main(String[] args){
A data = new A();
ArrayList list = new ArrayList();
for(int i=100;i<103;i++){
data.setVal(i);
list.add(data);
}
int j = 0;
while(j<list.size()){
A tmp = (A)list.get(j);
System.out.println("list("+j+")="+tmp.getVal());
j++;
}
}
}
運(yùn)行結(jié)果:
list(0)=102
list(1)=102
list(2)=102
8.hibernate導(dǎo)入大量數(shù)據(jù)時(shí),為了避免內(nèi)存中產(chǎn)生大量對(duì)象,在編碼時(shí)注意什么,如何去除?
9.視圖與表的區(qū)別
10.觸發(fā)器有哪幾種類(lèi)型
11.
事務(wù)操作有那幾個(gè)步驟
12.寫(xiě)出對(duì)應(yīng)正則表達(dá)式:
1)1-6位字母或數(shù)字;
[a-zA-Z0-9]{1,6}
2)手機(jī)號(hào)(只能是139或159開(kāi)頭,11位數(shù)字)
1[35][9][0-9]{8}
13.字符串反轉(zhuǎn):new StringBuilder(str).reverse().toString();
14.寫(xiě)程序:1+2²+3²+...+n²
int func(int n){
return n==1?1:func(n-1)+n*n
}
15.寫(xiě)一個(gè)延遲加載的單例模式:
public class SingleTon{
private static SingleTon instance = null;
private SingleTon(){}
public static SingleTon getInstance(){
if(instance == null){
synchronized(""){
if(instance == null){return new SingleTon();}
}
}
return instance;
}
}
16.
JSP的9種內(nèi)置對(duì)象:request:
HttpServletRequest類(lèi)的實(shí)例,客戶(hù)端的請(qǐng)求信息被封裝在request對(duì)象中response:
HttpServletResponse類(lèi)的實(shí)例,response對(duì)象包含了響應(yīng)客戶(hù)請(qǐng)求的有關(guān)信息,但在JSP中很少直接用到它。out:
out對(duì)象是JspWriter類(lèi)的實(shí)例,是向客戶(hù)端輸出內(nèi)容常用的對(duì)象session:
session對(duì)象指的是客戶(hù)端與服務(wù)器的一次會(huì)話,從客戶(hù)端連到服務(wù)器的一個(gè)WebApplication開(kāi)始,直到客戶(hù)端與服務(wù)器斷開(kāi)連接為止。它是HttpSession類(lèi)的實(shí)例page:
page對(duì)象就是指向當(dāng)前JSP頁(yè)面本身,有點(diǎn)象類(lèi)中的this指針,它是java.lang.Object類(lèi)的實(shí)例application:
ServletContext類(lèi)的實(shí)例,application對(duì)象實(shí)現(xiàn)了用戶(hù)間數(shù)據(jù)的共享,可存放全局變量。它開(kāi)始于服務(wù)器的啟動(dòng),直到服務(wù)器的關(guān)閉exception:
exception對(duì)象是一個(gè)例外對(duì)象,當(dāng)一個(gè)頁(yè)面在運(yùn)行過(guò)程中發(fā)生了例外,就產(chǎn)生這個(gè)對(duì)象。如果一個(gè)JSP頁(yè)面要應(yīng)用此對(duì)象,就必須把isErrorPage設(shè)為true,否則無(wú)法編譯。他實(shí)際上是java.lang.Throwable的對(duì)象pageContext:
pageContext對(duì)象提供了對(duì)JSP頁(yè)面內(nèi)所有的對(duì)象及名字空間的訪問(wèn),也就是說(shuō)他可以訪問(wèn)到本頁(yè)所在的SESSION,也可以取本頁(yè)面所在的application的某一屬性值,他相當(dāng)于頁(yè)面中所有功能的集大成者,它的本類(lèi)名也叫pageContextconfig:
config對(duì)象是在一個(gè)Servlet初始化時(shí),JSP引擎向它傳遞信息用的,此信息包括Servlet初始化時(shí)所要用到的參數(shù)(通過(guò)屬性名和屬性值構(gòu)成)以及服務(wù)器的有關(guān)信息(通過(guò)傳遞一個(gè)ServletContext對(duì)象)17.session和cookie的區(qū)別?
18.JDBC的操作步驟?
1.方法重載與多態(tài),簡(jiǎn)述;
2.什么是設(shè)計(jì)模式?使用過(guò)哪些?
3.列出熟悉的java開(kāi)源項(xiàng)目及簡(jiǎn)述;
4.一組radio,用alert彈出當(dāng)前所選的是第幾個(gè)radio?用原生javascript;
5.function showme(){
Book.prototype.abc = function(){
alert('456');
}
var abook = new Book(1,2);
Book.abc = function(){
alert('123');
}
abook.abc();
Book.abc();
abc();//此方法調(diào)用瀏覽器會(huì)報(bào)錯(cuò),未定義
}
function Book(a,b){
this.a = a;
this.b = b;
Book.abc = function(){
alert('def');
}
this.abc = function(){
alert('xyz');
}
abc = function(){
alert('@@@@@@');
}
var abc = function(){
alert('$$$$$$');
}
}
點(diǎn)擊按鈕調(diào)用showme(),頁(yè)面顯示結(jié)果為:
第一個(gè)彈出框:xyz
第二個(gè)彈出框:123
6.線程的四種狀態(tài)?
7.ext有哪些組件?ext如何與后臺(tái)交互?
8.HashMap放入、查找、刪除,將所有value放入一個(gè)數(shù)組,得到map中所有內(nèi)容;List添加、查找、刪除;
9.List<Student> student(name,age) 比較oldList<Student>和newList<student>,按名字比較,獲得新增的、修改的、刪除學(xué)生列表;
10.使用過(guò)哪些xml技術(shù)?怎么實(shí)現(xiàn)的?
11.java異常:throws、throw、try、catch、finally,舉例,如何處理異常
12.字符串反轉(zhuǎn):
public class TestKnowleage5 {
public static void main(String[] args){
System.out.println(reverse("abc"));
System.out.println(reverse2("abc"));
System.out.println(reverse3("abc"));
}
public static String reverse(String str){
return new StringBuffer(str).reverse().toString();
}
public static String reverse2(String str){
char[] chs = str.toCharArray();
char[] re = new char[chs.length];
for(int i = 0 ; i<chs.length;i++){
re[i] = chs[chs.length - i - 1];
}
return new String(re);
}
public static String reverse3(String str){
char[] chs = str.toCharArray();
String re = "";
for(int i = 0;i<chs.length;i++){
re += chs[chs.length - 1 -i];
}
return re;
}
}
//此句,編譯無(wú)法通過(guò),Cannot make a static reference to the non-static field b
1.arrayList、linkedList、vector的區(qū)別
2.寫(xiě)幾種J2EE規(guī)范并簡(jiǎn)要描述
3.什么是設(shè)計(jì)模式?用過(guò)哪些設(shè)計(jì)模式?
4.OO的四大特性是哪些?并簡(jiǎn)要描述
5.方法重載、多態(tài)概念及簡(jiǎn)要描述;
6.sql常用的優(yōu)化方法有哪些?
7.sleep()與wait()的區(qū)別?
8.
public class TestException {
public static void main(String[] args) {
int i = 1;
switch(i){
case 0:
System.out.println(0);
break;
case 1:
System.out.println(1);
default:
System.out.println(4);
case 2:
System.out.println(2);
case 3:
System.out.println(3);
}
}
}
運(yùn)行結(jié)果:
1
4
2
3
9.HashTable和HashMap的區(qū)別
10.怎樣理解mvc模式?
11.抽象類(lèi)、接口的區(qū)別?
12.智力題:
有1-7號(hào),7塊地,S、U、V、W、X 5個(gè)遺產(chǎn)繼承者,
S若繼承2號(hào),不能繼承3號(hào);
3號(hào)和4號(hào)不能同時(shí)繼承;
S若繼承一塊或多塊地,則U不能繼承
1塊地不能被2人合分;
問(wèn):若S繼承2號(hào)地,剩余3個(gè)人中,不能同時(shí)哪2塊地?
A:1和6 B:1和7 c:3和7 d:1和5 e:1和3
13.
public class TestKnowleage5 {
static int a;
int b,c=0;
public static void main(String[] args){
a++;
b++;//此句,編譯無(wú)法通過(guò),Cannot make a static reference to the non-static field b
c++; //此句,編譯無(wú)法通過(guò),cannot make a static reference to the non-static field c
參考文章:
1,有三個(gè)jsp頁(yè)面:a.jsp b.jsp c.jsp,流程是a.jsp--> b.jsp--> c.jsp,其中a.jsp提交的數(shù)據(jù)要在c.jsp中訪問(wèn),用最簡(jiǎn)單的辦法怎么做?不用session。
在b.jsp中放N個(gè)hidden隱藏域保存a.jsp中的數(shù)據(jù),一起提交到c.jsp,在c.jsp中取出。2.sql server支持集群么?
支持,不過(guò)屬于熱備份類(lèi)型,不能做負(fù)載均衡。不過(guò)符合你的條件
首先系統(tǒng)做集群,數(shù)據(jù)庫(kù)文件放到磁盤(pán)陣列里,雙機(jī)或多機(jī)共同訪問(wèn)磁盤(pán)陣列,就可以了,可以集群后做負(fù)載均衡;
3.HashTable與HashMap的區(qū)別:
1)HashMap非線程安全,HashTable線程安全;
2)HashMap可放一條key為空的記錄,任意記錄的value可為空,hashTable不可以;
3)hashMap去掉了contains方法,增加了containsKey和containsValue方法;
4.如何理解mvc模式:
mvc是sun提出的model2開(kāi)發(fā)模式,將控制、視圖、模型進(jìn)行了分離;提高了可維護(hù)性、擴(kuò)展性、可移植性、組件的可復(fù)用性;
5.SingleTon:
6.對(duì)象序列化的含義:
java序列化技術(shù)可以使你將一個(gè)對(duì)象的狀態(tài)寫(xiě)入一個(gè)byte流里,并且可以從其它地方把該byte流里的數(shù)據(jù)讀出來(lái),重新構(gòu)造一個(gè)相同的對(duì)象。
這種機(jī)制允許你將對(duì)象通過(guò)網(wǎng)絡(luò)傳播,并且隨時(shí)可以把對(duì)象持久化到數(shù)據(jù)庫(kù)、文件等系統(tǒng)里,java的序列化技術(shù)是RMI、EJB等技術(shù)的基礎(chǔ);
實(shí)現(xiàn)方法:implements Serializable標(biāo)記為可序列化,然后用ObjectOutputStream和ObjectInputStream讀寫(xiě);
7.數(shù)據(jù)庫(kù)中的鎖包含哪些?
排它鎖和共享鎖
8.jsp和servlet的區(qū)別:
1)簡(jiǎn)單來(lái)說(shuō):jsp就是含有java代碼的html,servlet就是含有html的java代碼;
2)jsp最終被解釋成servlet,編譯再執(zhí)行,jsp不過(guò)是servlet的另一種編寫(xiě)形式;
3)jsp擅長(zhǎng)表示,servlet擅長(zhǎng)數(shù)據(jù)處理,在mvc中jsp處于視圖層,servlet處于控制層;
9.oracle在數(shù)據(jù)庫(kù)中的交集怎么表示:
1)用intersect操作符 2)用in 語(yǔ)句
9.JNDI、JMS、JTA、RMI:
JNDI:java naming and directory interface java命名目錄接口
JMS:java messing service java消息服務(wù)
JTA:java transaction api java事務(wù)api
RMI:
Remote Method Invocation 遠(yuǎn)程方法調(diào)用
10.事務(wù):
1)ACID屬性:
A:atomic 原子性
C:consistent 一致性
I:isolation 隔離性
D:duration 持久性
2)概念:事務(wù)就是一系列操作,它們完成一項(xiàng)任務(wù)。只要這些操作里有一項(xiàng)沒(méi)成功,事務(wù)就操作失敗,發(fā)生回滾事件。即撤銷(xiāo)前面的操作,這樣可以保證數(shù)據(jù)的一致性。而且可以把操作放在緩存里,等所有操作都成功就提交數(shù)據(jù)庫(kù),這樣保證費(fèi)時(shí)的操作都是有效操作。
3)隔離級(jí)別 4)傳播行為
參考文檔:
http://wenku.baidu.com/view/56a532eb856a561252d36f81.html
1.String b = new String("1"+"2"); -->4個(gè)
2.Customer(id,name,phone,country);每個(gè)客戶(hù)均有地區(qū)(country)屬性,每個(gè)地區(qū)可有1或多個(gè)客戶(hù),查詢(xún)擁有超過(guò)10名客戶(hù)的地區(qū)的列表;
3.public interface TreeNode{
String getName();
List getChildren();
}
寫(xiě)一個(gè)print()方法,打印各級(jí)節(jié)點(diǎn)名稱(chēng).
4.String與StringBuffer的區(qū)別?
String
5.ajax名詞解釋?zhuān)暮诵膬r(jià)值及原理;
6.事務(wù)的概念及名詞解釋?zhuān)?br />7.數(shù)據(jù)庫(kù)表之間有幾種關(guān)系,并舉例;
8.Filter的原理,常見(jiàn)用例;
9.視圖與表的區(qū)別?觸發(fā)器類(lèi)型有哪些類(lèi)型?
10.建表及各種約束;
11.hibernate導(dǎo)入大量數(shù)據(jù)時(shí),為了避免內(nèi)存中產(chǎn)生大量對(duì)象,在編碼時(shí)注意什么,如何去除?
只有注冊(cè)用戶(hù)登錄后才能閱讀該文。
閱讀全文
一、unix:
1.ps -ef|grep tomcat
2.mkdir dir
3.打tar包:tar -cvf XXX.tar XXX
4.解壓tar包:tar -xvf XXX.tar
二、java
1.HashMap和HashTable的區(qū)別:HashMap不是線程安全的,HashTable是線程安全的
HashTable不允許null值(key和value都不可以),HashMap允許null值(key和value都可以)。
HashTable使用Enumeration,HashMap使用Iterator。
HashMap把Hashtable的contains方法去掉了,改成containsvalue和containsKey。
Hashtable是基于陳舊的Dictionary類(lèi),完成了Map接口;HashMap是Java 1.2引進(jìn)的Map接口的一個(gè)實(shí)現(xiàn)(HashMap繼承于AbstractMap,AbstractMap完成了Map接口)。
HashTable中hash數(shù)組默認(rèn)大小是11,增加的方式是 old*2+1。HashMap中hash數(shù)組的默認(rèn)大小是16,而且一定是2的指數(shù)。
哈希值的使用不同,HashTable直接使用對(duì)象的hashCode。
2.什么是java的序列化?如何實(shí)現(xiàn)java的序列化:
序列化就是一種用來(lái)處理對(duì)象流的機(jī)制,所謂對(duì)象流也就是將對(duì)象的內(nèi)容進(jìn)行流化。可以對(duì)流化后的對(duì)象進(jìn)行讀寫(xiě)操作,也可將流化后的對(duì)象傳輸于網(wǎng)絡(luò)之間。序列化是為了解決在對(duì)對(duì)象流進(jìn)行讀寫(xiě)操作時(shí)所引發(fā)的問(wèn)題。
序列化的實(shí)現(xiàn):將需要被序列化的類(lèi)實(shí)現(xiàn)Serializable接口,然后使用一個(gè)輸出流(如:FileOutputStream)來(lái)構(gòu)造一個(gè)ObjectOutputStream(對(duì)象流)對(duì)象,接著,使用ObjectOutputStream對(duì)象的writeObject(Object obj)方法就可以將參數(shù)為obj的對(duì)象寫(xiě)出(即保存其狀態(tài)),要恢復(fù)的話則用輸入流。
3.什么是java的單例模式?寫(xiě)一個(gè)單例模式;
單例模式:確保某一個(gè)類(lèi)只有一個(gè)實(shí)例,而且自行實(shí)例化并向整個(gè)系統(tǒng)提供這個(gè)實(shí)例。這個(gè)類(lèi)稱(chēng)為單例類(lèi)。
代碼清單1:餓漢式單例類(lèi)
public class EagerSingleton
{
private static final EagerSingleton m_instance = new EagerSingleton();
/**
* 私有的默認(rèn)構(gòu)造方法
*/
private EagerSingleton() { }
/**
* 靜態(tài)方法獲得單例
*/
public static EagerSingleton getInstance()
{
return m_instance;
}
}
代碼清單2:懶漢式單例類(lèi)
package com.javapatterns.singleton.demos;
public class LazySingleton
{
private static LazySingleton m_instance = null;
/**
* 私有的默認(rèn)構(gòu)造方法,保證外界無(wú)法直接實(shí)例化
*/
private LazySingleton() { }
/**
* 靜態(tài)方法,返還此類(lèi)的惟一實(shí)例
*/
public synchronized static LazySingleton getInstance()
{
if (m_instance == null)
{
m_instance = new LazySingleton();
}
return m_instance;
}
}
4.靜態(tài)塊與構(gòu)造器在繼承中的執(zhí)行順序:
public class TestExeuteOrder {
public static void main(String[] args) {
Parent p = new ChildTest();
p = new ChildTest();
}
}
class ChildTest extends Parent{
static{
System.out.println("in child static");
}
public ChildTest(){
System.out.println("in child construtor");
}
}
class Parent{
static{
System.out.println("in parent static");
}
public Parent(){
System.out.println("in parent construtor");
}
}運(yùn)行結(jié)果:in parent static
in child static
in parent construtor
in child construtor
in parent construtor
in child construtor5.成員內(nèi)部類(lèi):public class TestExeuteOrder{
class Inner{
void test(){
if(TestExeuteOrder.this.flag){
System.out.println("what a funny");
}
}
}
private boolean flag = true;
public TestExeuteOrder(){
new Inner().test();
}
public static void main(String[] args){
new TestExeuteOrder();
}
}運(yùn)行結(jié)果:what a funny6.參數(shù)傳遞:public class TestExeuteOrder{
public static void main(String[] args){
String a = "ello";
TestExeuteOrder t = new TestExeuteOrder();
t.change(a);
System.out.println(a);
}
public void change(String str){
str += "H";
}
}結(jié)果:ello7.參數(shù)傳遞2:public class TestExeuteOrder{
public static void main(String[] args){
StringBuffer x = new StringBuffer("A");
StringBuffer y = new StringBuffer("B");
change(x,y);
System.out.println(x+" "+y);
}
public static void change(StringBuffer a,StringBuffer b){
a.append(b);
b = a;
}
}結(jié)果為:AB B8.public class TestExeuteOrder{
public static void main(String[] args){
String a = "good";
char[] b = new char[]{'a','b','c'};
method(a,b);
System.out.println("a="+a+"------>b="+new String(b));
}
public static void method(String a,char[] b){
a = "Test ok";
b[0] = 'g';
}
}
結(jié)果:
a=good------>b=gbc
三、SQL:
1.存儲(chǔ)過(guò)程與函數(shù)的區(qū)別:
1)前者,程序頭部聲明用的是procedure;后者,程序頭部聲明用的是function;
2)前者,不需要描述返回類(lèi)型,后者需要;
3)前者可以作為一個(gè)獨(dú)立的pl/sql語(yǔ)句來(lái)執(zhí)行;后者不能獨(dú)立運(yùn)行,必須作為表達(dá)式的一部分條用;
4)sql語(yǔ)句中不可調(diào)用procedure,但可以調(diào)用function;
2.查詢(xún)student表中name重復(fù)的記錄:
select * from student where name in(select name from student group by sname having count(*) >1);3.table表中有兩列A,B,如果A>B選擇A,如果A<B,選擇B:
select( case when s1.A>s1.B then s1.A when s1.A<s1.B then s1.B end) re from student s1;
jar包不全,更新lib目錄后,不再報(bào)錯(cuò)。
1.公司速查手冊(cè) :
http://www.b1.tooyard.com/
2.分智網(wǎng):
http://www.fenzhi.com/ 3.我評(píng)it:
http://wopingit.com/ 4.企業(yè)點(diǎn)評(píng)網(wǎng):
http://www.71dp.com/ 5.中國(guó)企業(yè)評(píng)價(jià)網(wǎng):
http://www.ceea.net.cn/ 6.公司點(diǎn)評(píng)網(wǎng):
http://www.gsdpw.com/ 7.企業(yè)付費(fèi)邀請(qǐng)面試:
http://www.tradecv.com/
一、利用框架:
1.jre下的rt.jar中sun.net.ftpClient
2.common net 中的ftp包
二、ftp協(xié)議認(rèn)識(shí):
參考規(guī)范:RFC 959
1.文件傳輸協(xié)議:file transfer protocol (ftp)
2.名詞解釋?zhuān)?br />
DTP:數(shù)據(jù)傳輸過(guò)程
EOR:記錄尾
PI:協(xié)議解釋器
NTV:網(wǎng)絡(luò)虛擬終端
NVFS:網(wǎng)絡(luò)虛擬文件系統(tǒng)
3.控制連接是建立在USER-PIT和SERVER-PI之間用于交換命令與應(yīng)答的通信鏈路。
4.數(shù)據(jù)連接是傳輸數(shù)據(jù)的全雙工連接。傳輸數(shù)據(jù)可以發(fā)生在服務(wù)器DTP和用戶(hù)DTP之間也可以發(fā)生在兩個(gè)服務(wù)器DTP之間。
5.數(shù)據(jù)連接只傳輸數(shù)據(jù),控制連接傳送命令和響應(yīng)。
6.FTP使用Telnet協(xié)議進(jìn)行控制連接
7.
參考文章:
http://blog.csdn.net/williamzhou/article/details/215293
摘要: 文章來(lái)源:http://www.iteye.com/topic/7339711.通過(guò)getSession()方法獲得session進(jìn)行操作 Java代碼 public class Test extends HibernateDaoSupport{  ...
閱讀全文