




已閱讀5頁,還剩7頁未讀, 繼續(xù)免費閱讀
版權說明:本文檔由用戶提供并上傳,收益歸屬內容提供方,若內容存在侵權,請進行舉報或認領
文檔簡介
網龍筆試題:1、實現鏈表的創(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,內容例如如下:hello, everyone.my name is shen, he.ni, ne?則倒序之后為:everyone. hello,he. shen, is name myne? ni,源程序,自己實現的,算法是別人的。呵呵#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) /將該行字符整體翻轉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 != ) /找到一行的一個單詞b = i;while(*iter)i != & (*iter)i)i+;i;e = i;while (b e) /將這個單詞翻轉ch = (*iter)b;(*iter)b = (*iter)e;(*iter)e = ch;b+;e;i+;outFile *iter endl;+iter;return 0;新大陸面試題:(一)技術面試struts如何表現MVC模式的?Tomcat的部署?UML有哪些圖?Struts框架的好處(優(yōu)點)?答:1、是開源軟件,使開發(fā)者能更深入的了解其內部實現機制。 2、Taglib是Struts的標記庫,靈活動用,能大大提高開發(fā)效率;通過一個配置文件,即可把握整個系統(tǒng)各部分之間的聯系,這對于后期的維護有著莫大的好處。尤其是當另一批開發(fā)者接手這個項目時,這種優(yōu)勢體現得更加明顯。 4. 提供Exception處理機制 . 5. 數據庫鏈接池管理 6. 支持I18N Struts+Hibernate框架的優(yōu)勢?答:這兩種架構相結合很好地解決了系統(tǒng)的開發(fā)效率低、不易于維護、低耦合及可移植性差等問題.介紹一下AJAX?答:AJAX(Asynchronous JavaScript and XML)被贏得廣泛的認可,其原因是由于它縮短了Web應用程序和桌面應用程序之間的差距,并在其中充分結合可實現的技術和豐富的用戶體驗。AJAX是多種技術的綜合,它打破了頁面刷新的范式,使您的用戶快速方便的與 Web 應用程序交互。CVS配置與使用?POJO是什么?答:簡單的Java對象(Plain Old Java Objects),POJO對象有時也被稱為Data對象,大量應用于表現現實中的對象。概要設計與詳細設計等文檔的主要包含內容?(二)筆試內容Java基礎:Char變量.ClassLoader與Class.JDO.GC.等SQL方面:SQL全稱.查詢語句. Group by .having.update setJSP方面:靜態(tài)include與動態(tài)include第一部分: Java 基礎知識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 點評:TreeSet類實現了Set接口。Set的特點是其中的元素惟一,選項C正確。由于采用了樹形存儲方式,將元素有序地組織起來,所以選項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,只有參數列表不同,才做為標準,而返回值和訪問控制關鍵字不能做為標準,所以B錯在方法名相同,但只有返回值不同,這是錯的。C和D是正確的overload。對于override,則訪問控制關鍵字只能更加公有化,異常只能是超類方法拋出的異常的子類,也可以不拋出。返回類型,參數列表必須精確匹配。所以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” 點評:在Java中,每一個對象都有鎖。任何時候,該鎖都至多由一個線程控制。由于alias1與alias2指向同一對象Z,在執(zhí)行第11行前,線程擁有對象Z的鎖。在執(zhí)行完第11行以后,該線程釋放了對象Z的鎖,進入等待池。但此后沒有線程調用對象Z的notify()和notifyAll()方法,所以該進程一直處于等待狀態(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. 本站的文檔不包含任何第三方提供的附件圖紙等,如果需要附件,請聯系上傳者。文件的所有權益歸上傳用戶所有。
- 3. 本站RAR壓縮包中若帶圖紙,網頁內容里面會有圖紙預覽,若沒有圖紙預覽就沒有圖紙。
- 4. 未經權益所有人同意不得將文件中的內容挪作商業(yè)或盈利用途。
- 5. 人人文庫網僅提供信息存儲空間,僅對用戶上傳內容的表現方式做保護處理,對用戶上傳分享的文檔內容本身不做任何修改或編輯,并不能對任何下載內容負責。
- 6. 下載文件中如有侵權或不適當內容,請與我們聯系,我們立即糾正。
- 7. 本站不保證下載資源的準確性、安全性和完整性, 同時也不承擔用戶因使用這些下載資源對自己和他人造成任何形式的傷害或損失。
最新文檔
- 七年級生物上冊 1.1.1《我們周圍的生物》教學設計 (新版)蘇教版
- 初中英語牛津版 (深圳&廣州)七年級上冊(2012秋審查)Unit 5 visiting the moon公開課第2課時教案
- 二年級道德與法治上冊 第一單元 1《暑假中的一天》教學設計2 浙教版
- 五 分數除法 分數除法(二) 第2課時 教案
- 餐飲管理培訓課件
- 法律法規(guī)培訓
- 內蒙古興安盟烏蘭浩特市九年級歷史下冊 第7課 世界反法西斯戰(zhàn)爭的勝利教學設計 新人教版
- 七年級信息技術上冊 第五課 認識新同學教學設計
- 七年級英語下冊 Unit 6 I'm watching TV Section A第1課時(1a-2d)教學設計 (新版)人教新目標版
- 人教版歷史與社會七年級下冊第八單元第三課第一框《中華文明的曙光》教學設計
- 壓力性損傷管理制度
- 186F曲軸的設計與校核計算
- 上海安裝監(jiān)理工程師復習題 (JS安裝)
- 平面磨床控制線路
- 小學生天文知識競賽復習題庫及答案
- 土方填筑碾壓試驗方案(完整版)
- 往日時光(原版)鋼琴雙手簡譜_鋼琴譜_鋼琴簡譜
- 工地運輸車輛的危險源辨識與風險防控
- 2014—2015—2《刑法總論》教學大綱(修正版)
- 《美在身邊》PPT課件.ppt
- 2016年最新《援外出國人員生活待遇管理辦》法
評論
0/150
提交評論