




已閱讀5頁(yè),還剩7頁(yè)未讀, 繼續(xù)免費(fèi)閱讀
版權(quán)說(shuō)明:本文檔由用戶提供并上傳,收益歸屬內(nèi)容提供方,若內(nèi)容存在侵權(quán),請(qǐng)進(jìn)行舉報(bào)或認(rèn)領(lǐng)
文檔簡(jiǎn)介
網(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)記庫(kù),靈活動(dòng)用,能大大提高開發(fā)效率;通過(guò)一個(gè)配置文件,即可把握整個(gè)系統(tǒng)各部分之間的聯(lián)系,這對(duì)于后期的維護(hù)有著莫大的好處。尤其是當(dāng)另一批開發(fā)者接手這個(gè)項(xiàng)目時(shí),這種優(yōu)勢(shì)體現(xiàn)得更加明顯。 4. 提供Exception處理機(jī)制 . 5. 數(shù)據(jù)庫(kù)鏈接池管理 6. 支持I18N Struts+Hibernate框架的優(yōu)勢(shì)?答:這兩種架構(gòu)相結(jié)合很好地解決了系統(tǒng)的開發(fā)效率低、不易于維護(hù)、低耦合及可移植性差等問(wèn)題.介紹一下AJAX?答:AJAX(Asynchronous JavaScript and XML)被贏得廣泛的認(rèn)可,其原因是由于它縮短了Web應(yīng)用程序和桌面應(yīng)用程序之間的差距,并在其中充分結(jié)合可實(shí)現(xiàn)的技術(shù)和豐富的用戶體驗(yàn)。AJAX是多種技術(shù)的綜合,它打破了頁(yè)面刷新的范式,使您的用戶快速方便的與 Web 應(yīng)用程序交互。CVS配置與使用?POJO是什么?答:簡(jiǎn)單的Java對(duì)象(Plain Old Java Objects),POJO對(duì)象有時(shí)也被稱為Data對(duì)象,大量應(yīng)用于表現(xiàn)現(xiàn)實(shí)中的對(duì)象。概要設(shè)計(jì)與詳細(xì)設(shè)計(jì)等文檔的主要包含內(nèi)容?(二)筆試內(nèi)容Java基礎(chǔ):Char變量.ClassLoader與Class.JDO.GC.等SQL方面:SQL全稱.查詢語(yǔ)句. Group by .having.update setJSP方面:靜態(tài)include與動(dòng)態(tài)include第一部分: Java 基礎(chǔ)知識(shí)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)評(píng):TreeSet類實(shí)現(xiàn)了Set接口。Set的特點(diǎn)是其中的元素惟一,選項(xiàng)C正確。由于采用了樹形存儲(chǔ)方式,將元素有序地組織起來(lái),所以選項(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。對(duì)于overload,只有參數(shù)列表不同,才做為標(biāo)準(zhǔn),而返回值和訪問(wèn)控制關(guān)鍵字不能做為標(biāo)準(zhǔn),所以B錯(cuò)在方法名相同,但只有返回值不同,這是錯(cuò)的。C和D是正確的overload。對(duì)于override,則訪問(wèn)控制關(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)評(píng):在Java中,每一個(gè)對(duì)象都有鎖。任何時(shí)候,該鎖都至多由一個(gè)線程控制。由于alias1與alias2指向同一對(duì)象Z,在執(zhí)行第11行前,線程擁有對(duì)象Z的鎖。在執(zhí)行完第11行以后,該線程釋放了對(duì)象Z的鎖,進(jìn)入等待池。但此后沒(méi)有線程調(diào)用對(duì)象Z的notify()和notifyAll()方法,所以該進(jìn)程一直處于等待狀態(tài),沒(mé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. 本站所有資源如無(wú)特殊說(shuō)明,都需要本地電腦安裝OFFICE2007和PDF閱讀器。圖紙軟件為CAD,CAXA,PROE,UG,SolidWorks等.壓縮文件請(qǐng)下載最新的WinRAR軟件解壓。
- 2. 本站的文檔不包含任何第三方提供的附件圖紙等,如果需要附件,請(qǐng)聯(lián)系上傳者。文件的所有權(quán)益歸上傳用戶所有。
- 3. 本站RAR壓縮包中若帶圖紙,網(wǎng)頁(yè)內(nèi)容里面會(huì)有圖紙預(yù)覽,若沒(méi)有圖紙預(yù)覽就沒(méi)有圖紙。
- 4. 未經(jīng)權(quán)益所有人同意不得將文件中的內(nèi)容挪作商業(yè)或盈利用途。
- 5. 人人文庫(kù)網(wǎng)僅提供信息存儲(chǔ)空間,僅對(duì)用戶上傳內(nèi)容的表現(xiàn)方式做保護(hù)處理,對(duì)用戶上傳分享的文檔內(nèi)容本身不做任何修改或編輯,并不能對(duì)任何下載內(nèi)容負(fù)責(zé)。
- 6. 下載文件中如有侵權(quán)或不適當(dāng)內(nèi)容,請(qǐng)與我們聯(lián)系,我們立即糾正。
- 7. 本站不保證下載資源的準(zhǔn)確性、安全性和完整性, 同時(shí)也不承擔(dān)用戶因使用這些下載資源對(duì)自己和他人造成任何形式的傷害或損失。
最新文檔
- 以妙心禪意重塑靖江孤山寺景區(qū):環(huán)境優(yōu)化提升設(shè)計(jì)探索
- 幼兒園語(yǔ)言表達(dá)教育活動(dòng)計(jì)劃
- 疫情結(jié)束后班主任班級(jí)綜合素質(zhì)提升計(jì)劃
- 2025屆陜西省興平市西郊中學(xué)化學(xué)高一下期末綜合測(cè)試模擬試題含解析
- 2025年語(yǔ)文老師工作年度辭職報(bào)告模版(二)
- 2025年中國(guó)普通PPR管行業(yè)發(fā)展?jié)摿︻A(yù)測(cè)及投資戰(zhàn)略研究報(bào)告
- 浙江省麗水市2025年化學(xué)高一下期末質(zhì)量檢測(cè)模擬試題含解析
- 2022-2027年中國(guó)冷凍調(diào)理食品行業(yè)運(yùn)行態(tài)勢(shì)及未來(lái)發(fā)展趨勢(shì)預(yù)測(cè)報(bào)告
- 凍糕行業(yè)深度研究分析報(bào)告(2024-2030版)
- 中國(guó)推入式鉚釘行業(yè)市場(chǎng)規(guī)模及投資前景預(yù)測(cè)分析報(bào)告
- 弘揚(yáng)錢學(xué)森精神PPT忠誠(chéng)擔(dān)當(dāng)踐行科學(xué)報(bào)國(guó)之志PPT課件(帶內(nèi)容)
- 汽封加熱器 說(shuō)明書
- 上半年我國(guó)經(jīng)濟(jì)形勢(shì)分析與公司應(yīng)對(duì)策略
- 07勞動(dòng)力及資源配備計(jì)劃
- 精餾-化工分離工程課件
- 醫(yī)院健康體檢表完整
- 二年級(jí)上冊(cè)數(shù)學(xué)課件-2.1 乘法、除法一(乘法引入) ▏滬教版 (共16張PPT)
- 無(wú)人機(jī)駕駛員國(guó)家職業(yè)技能標(biāo)準(zhǔn)(2021年版)(word精排版)
- 中國(guó)教育學(xué)會(huì)會(huì)員申請(qǐng)表
- 黃大年式教師團(tuán)隊(duì)申報(bào)
- 新冀人版小學(xué)科學(xué)三年級(jí)下冊(cè)全冊(cè)教案(2022年春修訂)
評(píng)論
0/150
提交評(píng)論