J2EE+招聘試題.doc_第1頁
J2EE+招聘試題.doc_第2頁
J2EE+招聘試題.doc_第3頁
J2EE+招聘試題.doc_第4頁
J2EE+招聘試題.doc_第5頁
已閱讀5頁,還剩7頁未讀, 繼續(xù)免費(fèi)閱讀

下載本文檔

版權(quán)說明:本文檔由用戶提供并上傳,收益歸屬內(nèi)容提供方,若內(nèi)容存在侵權(quán),請進(jìn)行舉報(bào)或認(rèn)領(lǐng)

文檔簡介

網(wǎng)龍筆試題:1、實(shí)現(xiàn)鏈表的創(chuàng)建,刪除和逆序等。#include#includeusing namespace std;typedef struct stuint data;struct stu *next;node, list;node* creatlist(int n)node *h, *p, *s;h = new node;h-next = NULL;p = h;cout “please input ” n ” numbers.”;for(int i = 0; i s-data;s-next = NULL;p-next = s;p = s;return h;void deletelist (node *s, int a)node *p;while(s-data != a)p = s;s = s-next;if(s = NULL)cout next = s-next;delete s;void display(node *h)h = h-next;while(h != NULL)cout data next;cout next;q = p-next;while(q-next != NULL)s = q-next;q-next = p;p = q;q = s;q-next = p;h-next-next = NULL;h-next = q;return h;int main()int n;node *h;cout n;h= creatlist(n);display(h);cout n;deletelist(h, n);display(h);h = reverse(h);display(h);return 0;2、字符串逆序輸入文件是in.txt,內(nèi)容例如如下:hello, everyone.my name is shen, he.ni, ne?則倒序之后為:everyone. hello,he. shen, is name myne? ni,源程序,自己實(shí)現(xiàn)的,算法是別人的。呵呵#include#include#include#include#includeusing namespace std;int main()ifstream inFile;ofstream outFile;char *fName;string:size_type b,e;char ch;string line;vector svec;inFile.open(”in.txt”);while(getline(inFile, line) /先獲取每一行字符,并存入容器中svec.push_back(line);inFile.close();outFile.open(”out.txt”);vector:iterator iter = svec.begin();while(iter != svec.end()b = 0;e = (*iter).size() 1;while( b e) /將該行字符整體翻轉(zhuǎn)ch = (*iter)b;(*iter)b = (*iter)e;(*iter)e = ch;b+;e;b = 0;e = 0;string:size_type i = 0;while( (*iter)i )if(*iter)i != ) /找到一行的一個(gè)單詞b = i;while(*iter)i != & (*iter)i)i+;i;e = i;while (b e) /將這個(gè)單詞翻轉(zhuǎn)ch = (*iter)b;(*iter)b = (*iter)e;(*iter)e = ch;b+;e;i+;outFile *iter endl;+iter;return 0;新大陸面試題:(一)技術(shù)面試struts如何表現(xiàn)MVC模式的?Tomcat的部署?UML有哪些圖?Struts框架的好處(優(yōu)點(diǎn))?答:1、是開源軟件,使開發(fā)者能更深入的了解其內(nèi)部實(shí)現(xiàn)機(jī)制。 2、Taglib是Struts的標(biāo)記庫,靈活動用,能大大提高開發(fā)效率;通過一個(gè)配置文件,即可把握整個(gè)系統(tǒng)各部分之間的聯(lián)系,這對于后期的維護(hù)有著莫大的好處。尤其是當(dāng)另一批開發(fā)者接手這個(gè)項(xiàng)目時(shí),這種優(yōu)勢體現(xiàn)得更加明顯。 4. 提供Exception處理機(jī)制 . 5. 數(shù)據(jù)庫鏈接池管理 6. 支持I18N Struts+Hibernate框架的優(yōu)勢?答:這兩種架構(gòu)相結(jié)合很好地解決了系統(tǒng)的開發(fā)效率低、不易于維護(hù)、低耦合及可移植性差等問題.介紹一下AJAX?答:AJAX(Asynchronous JavaScript and XML)被贏得廣泛的認(rèn)可,其原因是由于它縮短了Web應(yīng)用程序和桌面應(yīng)用程序之間的差距,并在其中充分結(jié)合可實(shí)現(xiàn)的技術(shù)和豐富的用戶體驗(yàn)。AJAX是多種技術(shù)的綜合,它打破了頁面刷新的范式,使您的用戶快速方便的與 Web 應(yīng)用程序交互。CVS配置與使用?POJO是什么?答:簡單的Java對象(Plain Old Java Objects),POJO對象有時(shí)也被稱為Data對象,大量應(yīng)用于表現(xiàn)現(xiàn)實(shí)中的對象。概要設(shè)計(jì)與詳細(xì)設(shè)計(jì)等文檔的主要包含內(nèi)容?(二)筆試內(nèi)容Java基礎(chǔ):Char變量.ClassLoader與Class.JDO.GC.等SQL方面:SQL全稱.查詢語句. Group by .having.update setJSP方面:靜態(tài)include與動態(tài)include第一部分: Java 基礎(chǔ)知識1. What will happen when you attempt to compile and run the following code? public class Test static int x = 5; static int x, y; public static void main(String args) x-; myMethod(); System.out.println(x + y + +x); public static void myMethod() y = x+ + +x; A. compiletime error B. prints: 1 C. prints: 2 D. prints: 3 E. prints: 7 F. prints: 8 2. Which of the following collection classes from java.util package are Thread safe? (Choose two)A. Vector B. ArrayListC. HashMap D. Hashtable 3 Which of the following types is primitive java type?(Choose two)A StringB intC charD Short4Which two demonstrate a has a relationship? (Choose two) A. public interface Person public class Employee extends Person B. public interface Shape public interface Rectandle extends Shape C. public interface Colorable public class Shape implements Colorable D. public class Species public class Animalprivate Species species; E. interface Component class Container implements Component private Component children; 5. What is the result when you compile and run the following code? public class ThrowsDemo static void throwMethod() System.out.println(Inside throwMethod.); throw new IllegalAccessException(demo); public static void main(String args) try throwMethod(); catch (IllegalAccessException e) System.out.println(Caught + e); A. compile error B. runtime error C. compile successfully, nothing is printed. D. inside throwMethod followed by caught: java.lang.IllegalAccessException: demo 6. Which two statements are true for the class java.util.TreeSet? (Choose two) A. The elements in the collection are ordered. B. The collection is guaranteed to be immutable. C. The elements in the collection are guaranteed to be unique. D. The elements in the collection are accessed using a unique key. E. The elements in the collection are guaranteed to be synchronized 點(diǎn)評:TreeSet類實(shí)現(xiàn)了Set接口。Set的特點(diǎn)是其中的元素惟一,選項(xiàng)C正確。由于采用了樹形存儲方式,將元素有序地組織起來,所以選項(xiàng)A也正確。7. What will be printed when you execute the following code? class X Y b = new Y(); X() System.out.print(X); class Y Y() System.out.print(Y); public class Z extends X Y y = new Y(); Z() System.out.print(Z); public static void main(String args) new Z(); A. Z B. YZ C. XYZ D. YXYZ 8. which two declaretions prevent the overriding of a method? A. final void methoda() B. void final methoda() C. static void methoda() D. static final void methoda() E. final abstract void methoda() 9. You want a class to have access to members of another class in the same package which is the most restrictive access modifier that will accomplish this objective? A. public B. private C. protected D. transient E. No access modifier is required 10. which two interfaces provide the capability to store objects using a key-value pair? A. java.util.Map B. java.util.Set C. java.util.List D. java.util.SortedSet E. java.util.SortedMap F. java.util.Collection 11.1) class Super 2) public float getNum()return 3.0f; 3) 4) 5) public class Sub extends Super 6) 7) which method, placed at line 6, will cause a compiler error? A. public float getNum()return 4.0f; B. public void getNum() C. public void getNum(double d) D. public double getNum(float d)return 4.0d; 注意這道題主要考的是方法的overload和override。對于overload,只有參數(shù)列表不同,才做為標(biāo)準(zhǔn),而返回值和訪問控制關(guān)鍵字不能做為標(biāo)準(zhǔn),所以B錯(cuò)在方法名相同,但只有返回值不同,這是錯(cuò)的。C和D是正確的overload。對于override,則訪問控制關(guān)鍵字只能更加公有化,異常只能是超類方法拋出的異常的子類,也可以不拋出。返回類型,參數(shù)列表必須精確匹配。所以A是正確的override。12. which gets the name of the parent directory of file file.txt? A. String name=File.getParentName(file.txt); B. String name=(new File(file.txt).getParent(); C.Stringname=(new File(file.txt).getParentName(); D.Stringname=(new File(file.txt).getParentFile(); E.Diretorydir=(new File(file.txt).getParentDir(); String name=dir.getName(); 13What happens when you try to compile and run the following application? Choose all correct options. 1. public class Z 2. public static void main(String args) 3. new Z(); 4. 5. 6. Z() 7. Z alias1 = this; 8. Z alias2 = this; 9. synchronized(alias1) 10. try 11. alias2.wait(); 12. System.out.println(“DONE WAITING”); 13. 14. catch (InterruptedException e) 15. System.out.println(“INTERR UPTED”); 16. 17. catch (Exception e) 18. System.out.println(“OTHER EXCEPTION”); 19. 20. finally 21. System.out.println (“FINALLY”); 22. 23. 24. System.out.println(“ALL DONE”); 25. 26. A. The application compiles but doesnt print anything. B. The application compiles and print “DONE WAITING” C. The application compiles and print “FINALLY” D. The application compiles and print “ALL DONE” E. The application compiles and print “INTERRUPTED” 點(diǎn)評:在Java中,每一個(gè)對象都有鎖。任何時(shí)候,該鎖都至多由一個(gè)線程控制。由于alias1與alias2指向同一對象Z,在執(zhí)行第11行前,線程擁有對象Z的鎖。在執(zhí)行完第11行以后,該線程釋放了對象Z的鎖,進(jìn)入等待池。但此后沒有線程調(diào)用對象Z的notify()和notifyAll()方法,所以該進(jìn)程一直處于等待狀態(tài),沒有輸出。14. What results from attempting to compile and run the following code? public class Ternary public static void main(String args) int a = 5; System.out.println(Value is - + (a 5) ? 9.9 : 9); A. print:Value is -9 B. print:Value is -5 C. Compilation error D. None of these第二部

溫馨提示

  • 1. 本站所有資源如無特殊說明,都需要本地電腦安裝OFFICE2007和PDF閱讀器。圖紙軟件為CAD,CAXA,PROE,UG,SolidWorks等.壓縮文件請下載最新的WinRAR軟件解壓。
  • 2. 本站的文檔不包含任何第三方提供的附件圖紙等,如果需要附件,請聯(lián)系上傳者。文件的所有權(quán)益歸上傳用戶所有。
  • 3. 本站RAR壓縮包中若帶圖紙,網(wǎng)頁內(nèi)容里面會有圖紙預(yù)覽,若沒有圖紙預(yù)覽就沒有圖紙。
  • 4. 未經(jīng)權(quán)益所有人同意不得將文件中的內(nèi)容挪作商業(yè)或盈利用途。
  • 5. 人人文庫網(wǎng)僅提供信息存儲空間,僅對用戶上傳內(nèi)容的表現(xiàn)方式做保護(hù)處理,對用戶上傳分享的文檔內(nèi)容本身不做任何修改或編輯,并不能對任何下載內(nèi)容負(fù)責(zé)。
  • 6. 下載文件中如有侵權(quán)或不適當(dāng)內(nèi)容,請與我們聯(lián)系,我們立即糾正。
  • 7. 本站不保證下載資源的準(zhǔn)確性、安全性和完整性, 同時(shí)也不承擔(dān)用戶因使用這些下載資源對自己和他人造成任何形式的傷害或損失。

最新文檔

評論

0/150

提交評論