欧美色欧美亚洲高清在线观看,国产特黄特色a级在线视频,国产一区视频一区欧美,亚洲成a 人在线观看中文

  1. <ul id="fwlom"></ul>

    <object id="fwlom"></object>

    <span id="fwlom"></span><dfn id="fwlom"></dfn>

      <object id="fwlom"></object>

      java筆試題06

      時(shí)間:2019-05-13 17:43:22下載本文作者:會(huì)員上傳
      簡介:寫寫幫文庫小編為你整理了多篇相關(guān)的《java筆試題06》,但愿對你工作學(xué)習(xí)有幫助,當(dāng)然你在寫寫幫文庫還可以找到更多《java筆試題06》。

      第一篇:java筆試題06

      Using the java.lang.String Class 1.Given the following, 1.public class StringRef { 2.public static void main(String [] args){ 3.String s1 = “abc”;4.String s2 = “def”;5.String s3 = s2;6.s2 = “ghi”;7.System.out.println(s1 + s2 + s3);8.} 9.} what is the result? A.abcdefghi B.abcdefdef C.abcghidef D.abcghighi E.Compilation fails.F.An exception is thrown at runtime.2.Given the following, 11.String x = “xyz”;12.x.toUpperCase();13.String y = x.replace('Y', 'y');14.y = y + “abc”;15.System.out.println(y);what is the result? A.abcXyZ B.abcxyz C.xyzabc D.XyZabc E.Compilation fails.F.An exception is thrown at runtime.3.Given the following, 13.String x = new String(“xyz”);生成兩個(gè)字符串 14.String y = “abc”;15.x = x + y;how many String objects have been created? A.2 B.3 C.4 D.5 4.Given the following, 14.String a = “newspaper”;15.a = a.substring(5,7);substring截字符串的,截取到end-1 的位置 16.char b = a.charAt(1);charAt他是截取單個(gè)字符,從0開始 17.a = a + b;18.System.out.println(a);what is the result? A.apa B.app C.apea D.apep E.papp F.papa 5.Given the following, 4.String d = “bookkeeper”;5.d.substring(1,7);6.d = “w” + d;7.d.append(“woo”);String類沒有append()方法 8.System.out.println(d);what is the result? A.wookkeewoo B.wbookkeeper C.wbookkeewoo D.wbookkeeperwoo E.Compilation fails.F.An exception is thrown at runtime.Using the java.lang.Math Class 6.Given the following, 1.public class Example { 2.public static void main(String [] args){ 3.double values[] = {-2.3,-1.0, 0.25, 4};4.int cnt = 0;5.for(int x=0;x < values.length;x++){ 6.if(Math.round(values[x] +.5)== Math.ceil(values[x])){ 7.++cnt;8.} 9.} 10.System.out.println(“same results ” + cnt + “ time(s)”);11.} 12.} what is the result? Round:四舍五入

      Math.round(11.6)= 12 Math.round(-11.6)=-12 Ceil:向上取整

      Math.ceil(x)>= Floor:向下取整

      Math.floor(x)<= x A.same results 0 time(s)B.same results 2 time(s)C.same results 4 time(s)D.Compilation fails.E.An exception is thrown at runtime.7.Which of the following are valid calls to Math.max?(Choose all that apply.)(Yeah, yeah, we know that on the real exam you’d know how many were correct, but we just want you to work a little harder here.)A.Math.max(1,4)B.Math.max(2.3, 5)C.Math.max(1, 3, 5, 7)D.Math.max(-1.5,-2.8f)8.What two statements are true about the result obtained from calling Math.random()?(Choose two.)Math.random()返回【0,1)的數(shù),無盡接近于1; A.The result is less than 0.0.B.The result is greater than or equal to 0.0..C.The result is less than 1.0.D.The result is greater than 1.0.E.The result is greater than or equal to 1.0.F.The result is less than or equal to 1.0.9.Given the following, 1.public class SqrtExample { 2.public static void main(String [] args){ 3.double value =-9.0;4.System.out.println(Math.sqrt(value));5.} 6.} what is the result? Math.sqrt():他是開平方的,double的負(fù)數(shù)開平方的結(jié)果是NaN; A.3.0 B.–3.0 C.NaN D.Compilation fails.E.An exception is thrown at runtime.10.Given the following, 1.public class Degrees { 2.public static void main(String [] args){ 3.System.out.println(Math.sin(75));Math.sin(double x)//x是弧度數(shù) 4.System.out.println(Math.toDegrees(Math.sin(75)));是弧度數(shù)5.System.out.println(Math.sin(Math.toRadians(75)));將參數(shù)制定的弧度轉(zhuǎn)換為對

      應(yīng)的角度

      6.System.out.println(Math.toRadians(Math.sin(75)));將參數(shù)的角度數(shù)轉(zhuǎn)換成弧度 7.} 8.} at what line will the sine of 75 degrees be output? A.Line 3 B.Line 4 C.Line 5 D.Line 6 E.Line 3 and either line 4, 5, or 6 F.None of the above Using Wrapper Classes 要使用1.4版本

      11.Given the following, 1.public class WrapTest2 { 2.public static void main(String [] args){ 3.Long b = new Long(42);4.int x = Integer.valueOf(“345”);5.int x2 =(int)Integer.parseInt(“345”, 8);6.int x3 = Integer.parseInt(42);7.int x4 = Integer.parseInt(“42”);8.int x5 = b.intValue();9.} 10.} which two lines will cause compiler errors?(Choose two.)A.Line 3 B.Line 4 C.Line 5 D.Line 6 E.Line 7 F.Line 8 12.Given the following, 1.public class NFE { 2.public static void main(String [] args){ 3.String s = “42”;4.try { 5.s = s.concat(“.5”);6.double d = Double.parseDouble(s);7.s = Double.toString(d);8.int x =(int)Math.ceil(Double.valueOf(s).doubleValue());9.System.out.println(x);10.} 11.catch(NumberFormatException e){ 12.System.out.println(“bad number”);13.} 14.} 15.} what is the result? A.42 B.42.5 C.43 D.bad number E.Compilation fails.F.An uncaught exception is thrown at runtime.13.Given the following, 1.public class BoolTest { 2.public static void main(String [] args){ 3.Boolean b1 = new Boolean(“false”);4.boolean b2;5.b2 = b1.booleanValue();6.if(!b2){ 7.b2 = true;8.System.out.print(“x ”);9.} 10.if(b1 & b2){ //Boolean & boolean是不可以的 11.System.out.print(“y ”);12.} 13.System.out.println(“z”);14.} 15.} what is the result? A.z B.x z C.y z D.x y z E.Compilation fails.F.An exception is thrown at runtime.14.Given the following, 1.public class WrapTest3 { 2.public static void main(String [] args){ 3.String s = “98.6”;4.// insert code here 5.} 6.} which three lines inserted independently at line 4 will cause compiler errors?(Choose three.)A.float f1 = Float.floatValue(s);floatValue 是非static 的 B.float f2 = Float.valueOf(s);valueOf()返回是Float類型的 C.float f3 = new Float(3.14f).floatValue();D.float f4 = Float.parseFloat(1.23f);parseFloat(String)參數(shù)的String E.float f5 = Float.valueOf(s).floatValue();F.float f6 =(float)Double.parseDouble(“3.14”);15.Given the following, 11.try { 12.Float f1 = new Float(“3.0”);13.int x = f1.intValue();14.byte b = f1.byteValue();15.double d = f1.doubleValue();16.System.out.println(x + b + d);17.} 18.catch(NumberFormatException e){ 19.System.out.println(“bad number”);20.} what is the result? A.9.0 B.bad number C.Compilation fails on line 13.D.Compilation fails on line 14.E.Compilation fails on lines 13 and 14.F.An uncaught exception is thrown at runtime.Using equals()16.Given the following, 1.public class WrapTest { 2.public static void main(String [] args){ 3.int result = 0;4.short s = 42;5.Long x = new Long(“42”);6.Long y = new Long(42);7.Short z = new Short(“42”);8.Short x2 = new Short(s);9.Integer y2 = new Integer(“42”);10.Integer z2 = new Integer(42);11.12.if(x == y)result = 1;13.if(x.equals(y))result = result + 10;14.if(x.equals(z))result = result + 100;15.if(x.equals(x2))result = result + 1000;16.if(x.equals(z2))result = result + 10000;17.18.System.out.println(“result = ” + result);19.} 20.} what is the result? A.result = 1 B.result = 10 C.result = 11 D.result = 11010 E.result = 11011 F.result = 11111 17.Given the following, 1.public class BoolTest { 2.public static void main(String [] args){ 3.int result = 0;4.5.Boolean b1 = new Boolean(“TRUE”);6.Boolean b2 = new Boolean(“true”);7.Boolean b3 = new Boolean(“tRuE”);8.Boolean b4 = new Boolean(“false”);9.10.if(b1 == b2)result = 1;11.if(b1.equals(b2))result = result + 10;12.if(b2 == b4)result = result + 100;13.if(b2.equals(b4))result = result + 1000;14.if(b2.equals(b3))result = result + 10000;15.16.System.out.println(“result = ” + result);17.} 18.} what is the result? A.0 B.1 C.10 D.1100 E.10001 F.10010 18.Given the following, 1.public class ObjComp { 2.public static void main(String [] args){ 3.int result = 0;4.ObjComp oc = new ObjComp();5.Object o = oc;6.7.if(o == oc)result = 1;8.if(o!= oc)result = result + 10;9.if(o.equals(oc))result = result + 100;10.if(oc.equals(o))result = result + 1000;11.12.System.out.println(“result = ” + result);13.} 14.} what is the result? A.1 B.10 C.101 D.1001 E.1101 19.Which two statements are true about wrapper or String classes?(Choose two.)A.If x and y refer to instances of different wrapper classes, then the fragment x.equals(y)will cause a compiler failure.B.If x and y refer to instances of different wrapper classes, then x == y can sometimes be true.C.If x and y are String references and if x.equals(y)is true, then x == y is true.D.If x, y, and z refer to instances of wrapper classes and x.equals(y)is true, and y.equals(z)is true, then z.equals(x)will always be true.E.If x and y are String references and x == y is true, then y.equals(x)will be true.

      第二篇:JAVA工程師筆試題

      一、選擇題

      1.Java中提供了名為()的包裝類來包裝原始字符串類型。A.Integer B.Char C.Double D.String

      2.java.lang包的()方法比較兩個(gè)對象是否相等,相等返回true。A.toString()B.equals()C.compare()

      D.以上所有選項(xiàng)都不正確

      3.下面的集合中,()不可以存儲(chǔ)重復(fù)元素。A.Set B.Collection C.Map D.List 4.Java接口的修飾符可以為()

      A private B protected C final D abstract

      5.下面哪些是Thread類的方法()

      A start()B run()C exit()D getPriority()

      6.下面關(guān)于java.lang.Exception類的說法正確的是()

      A 繼承自Throwable B Serialable C集成自Error D以上都不正確

      7.下面程序的運(yùn)行結(jié)果:()

      public static void main(String[] args){ // TODO Auto-generated method stub Thread t = new Thread(){ public void run(){ pong();} };t.run();System.out.print(“ping”);} static void pong(){ System.out.print(“pong”);}

      A pingpong B pongping C pingpong和pongping都有可能 D 都不輸出

      8.下面哪個(gè)流類屬于面向字符的輸入流()A BufferedWriter B FileInputStream C ObjectInputStream D InputStreamReader

      9.ArrayList list = new ArrayList(20);中的list擴(kuò)充幾次()

      A 0 B 1 C 2 D 3

      二、問答題

      1.String與StringBuffer的區(qū)別?

      2.談?wù)刦inal、finally、finalize的區(qū)別?

      3.創(chuàng)建一個(gè)對象的方法有哪些?

      4.編寫一個(gè)程序,產(chǎn)生ArrayIndexOutOfBoundsException異常,并捕獲該異常,在控制臺(tái)輸出異常信息。

      5.寫一個(gè)線程安全的Singleton實(shí)例

      6.請用JAVA代碼實(shí)現(xiàn)拷貝一個(gè)大于2G的文件到其他盤。

      7.設(shè)計(jì)四個(gè)線程,其中兩個(gè)線程每次對變量i加1,另外兩個(gè)線程每次對i減1.8.自己編寫代碼,實(shí)現(xiàn)生產(chǎn)者-消費(fèi)者模型功能.內(nèi)容自由發(fā)揮,只需要表達(dá)思想.9.在Mysql中,請用一條SQL語句將現(xiàn)有的三條記錄復(fù)制一下,達(dá)到以下的效果: ID name pass

      aaa 111

      bbb 222

      ccc 333

      aaa 111

      bbb 222

      ccc 333

      10.用SQL語句刪除上一題的重復(fù)記錄.。

      第三篇:JAVA程序員筆試題

      深圳市九城恩科軟件技術(shù)有限公司

      java程序員筆試題

      JAVA 程序員筆試題

      時(shí)間:30分鐘

      試題一:

      簡單描述一下什么是事務(wù)管理,事務(wù)管理中有哪些語句?

      姓名:

      試題二:

      跳出當(dāng)前循環(huán)的關(guān)鍵詞是什么?繼續(xù)本次循環(huán)的關(guān)鍵詞是什么?

      試題三:

      在JSP頁面源代碼中寫 “${flag}”是代表什么意思?

      試題四:

      請寫出最少五種設(shè)計(jì)模式的名稱。

      試題五:

      請寫出Eclipse 中下列功能的快捷鍵: 刪除當(dāng)前行: 注釋當(dāng)前行:

      代碼助手完成一些代碼的插入: 打開類型: 打開資源:

      試題六:

      什么情況下Eclipse不編譯生成Class文件?

      深圳市九城恩科軟件技術(shù)有限公司

      java程序員筆試題

      試題七:

      public static void main(String[] args){

      int i=3,j=16;do{ if(++i>=j--)continue;}while(i<9);System.out.println(“i=”+i+“;j=”+j);} 這段程序運(yùn)行后輸出的結(jié)果是什么?

      試題八:

      public class One {

      } public class Two extends One {

      } protected void printA(){System.out.println(“two A”);} private void printB(){System.out.println(“two B”);} public static void main(String[] args){ Two t = new Two();t.printAB();} protected void printA(){System.out.println(“one A”);} private void printB(){System.out.println(“one B”);} protected void printAB(){printA();printB();} 這段程序運(yùn)行后輸出的結(jié)果是什么?

      試題九:

      有一個(gè)表 “表A” 中包含 “姓名”,“成績”兩個(gè)字段,請寫一個(gè)SQL語句查詢出“成績”大于60分的,“姓名”有重復(fù)的人的名字

      試題十:

      請寫一個(gè)方法實(shí)現(xiàn):傳入的一個(gè)大于10位的字符串,把字符串的最后兩位移動(dòng)到字符串的第4位后面。

      第四篇:Java程序員筆試題

      Java程序員筆試題

      說明:該份題目要求在1小時(shí)內(nèi)答完

      1、工廠方法模式和抽象工廠模式的區(qū)別

      2、jsp/servlet 中 forward, include, reDirect 之間的區(qū)別

      3、JSP中的兩種include包含指令的區(qū)別與用法

      4、ArrayList和Vector的區(qū)別,HashMap和Hashtable及HashSet的區(qū)別?

      5、請說明在實(shí)際應(yīng)用中,java.sql 包中的Statement和PreparedStatement有何區(qū)別?

      6、如何遍歷一個(gè)集合(collection),并在屏幕上打印出集合中的每個(gè)元素public void printStr

      (Collection cols){

      }

      7、寫一個(gè)方法,實(shí)現(xiàn)字符串的反轉(zhuǎn),例如:輸入abc,輸出cba

      PublicString reverseStr(String str){

      //代碼

      }

      8、輸入為整數(shù)數(shù)組,請寫出如下的排序算法,使得數(shù)組data里面存儲(chǔ)的數(shù)字隨數(shù)組腳標(biāo)的增大而依

      次增大,即越小的數(shù)字存儲(chǔ)的位置越靠前

      Public void sort(int[]data){

      }

      9、用戶在JSP: input.jsp中輸入姓名和手機(jī)號(hào)碼,點(diǎn)”Done”按鈕來提交請求到一個(gè)/ 6

      servlet:test.java。test.java將輸入的姓名和手機(jī)號(hào)碼存儲(chǔ)在文件store.txt里。

      請寫出input.jsp, test.java的程序源碼,并在input.jsp和test.java中分別通過js和java代碼對輸入進(jìn)行校驗(yàn),如果1)姓名項(xiàng)沒有填寫或者輸入的長度超過了20個(gè)字符2)手機(jī)號(hào)碼項(xiàng)沒有填寫,或者輸入了非數(shù)字的字符或者輸入的長度不是13位,則返回input.jsp,并給出相應(yīng)的錯(cuò)誤提示。

      10、有若干條有關(guān)城市的信息,每條包括如下屬性:ID(唯一遞增的序列),CITY(城市名稱),DESC(城市說明),要求設(shè)計(jì)一套數(shù)據(jù)結(jié)構(gòu)及算法使得1)所有登陸系統(tǒng)的用戶均能使用這些城市信息2)能夠根據(jù)城市ID 號(hào)或名稱獲得城市的其他信息3)如果從該數(shù)據(jù)結(jié)構(gòu)中找不到合適的城市信息,可以往該數(shù)據(jù)結(jié)構(gòu)中添加新的城市信息,但相同的城市(ID號(hào)或名稱有任意一個(gè)相同均認(rèn)為是同一城市)在數(shù)據(jù)結(jié)構(gòu)中只能有一條記錄 4)如任一條城市信息,超過兩個(gè)小時(shí)沒有被使用(查詢)則需自動(dòng)將其刪除

      pubic class CityCache{

      }

      11、讀下面一段程序,寫出運(yùn)行結(jié)果

      ----

      pubicclassBaseClass{

      static{

      System.out.println(“aaaaa”);/ 6

      }

      BaseClass(){

      System.out.println(“11111”);

      }

      }

      publicclassDerivedClass

      extendsBaseClass{

      static{

      System.out.println(“bbbbb”);

      }

      DerivedClass(){

      System.out.println(“22222”);

      }

      }

      publicclassStartRun {

      public static void main(String[ ] args){

      DerivedClasssdc 1 = newDerivedClass();

      dc1 = newDerivedClass();

      }

      }

      12、請寫出符合要求的sql 語句(假定數(shù)據(jù)庫為Oracle)。/ 6

      現(xiàn)有數(shù)據(jù)表a,建表語句如下:

      create table a(bm char(4),——編碼

      mc varchar2(20)——名稱)

      表中數(shù)據(jù)如下

      bmmc

      11111111

      11121111

      11131111

      11141111

      要求1:用一條sql語句實(shí)現(xiàn)對表a中數(shù)據(jù)的復(fù)制,即達(dá)到如下的結(jié)果(2)bmmc

      11111111

      11121111

      11131111

      11141111

      11111111

      11121111

      11131111

      11141111/ 6

      要求2:請刪除表中重復(fù)的記錄(bm和mc都相同的記錄為重復(fù)記錄)

      13、classStack {

      LinkedListlist = new LinkedList()

      public synchronized void push(Objectx){

      synchronized(list){

      list.addLast(x);

      notify();

      }

      }

      public synchronized Object pop(){

      synchronized(list){

      if(list.size()<=0)

      wait();

      return list.removeLast();

      }

      }/ 6

      }

      請問上面這個(gè)類中有什么錯(cuò)誤?應(yīng)該怎么解決?14、15、請寫出MSSQL、ServerMysql和ORACE實(shí)現(xiàn)分頁算法的sql語句。UNIX和網(wǎng)絡(luò)基礎(chǔ),依次寫出完成下列的操作命令,最好有常用參數(shù)的簡單說明

      1)如何顯示當(dāng)前的IP配置信息

      2)查看當(dāng)前目錄

      3)拷貝文件或目錄

      4)移動(dòng)文件或目錄

      5)刪除文件或目錄

      6)切換用戶

      7)修改文件或目錄的權(quán)限

      8)查看日志文件的最后1行

      9)查看系統(tǒng)內(nèi)存、CPU的使用狀況

      10)查看系統(tǒng)正在運(yùn)行的和apache相關(guān)的進(jìn)程/ 6

      第五篇:軟件開發(fā)工程師(JAVA)筆試題A

      JAVA筆試題

      ? 軟件開發(fā)工程師(JAVA)筆試題

      請?jiān)?0分鐘以內(nèi)做答 答案請寫在答題紙上

      一、選擇題

      1、下面哪項(xiàng)是不合法的標(biāo)識(shí)符:(c e)A.$persons B.TwoUsers C.*point D._endline E.final

      2、下列運(yùn)算符合法的是(a)

      A.&& B.<> C.if D.:=

      3、下面描述中哪兩項(xiàng)相等:(bg)[選擇兩項(xiàng)] A.<%= YoshiBean.size%> B.<%= YoshiBean.getSize()%> C.<%= YoshiBean.getProperty(“size”)%>

      D. E. F. G.

      4、設(shè)float x = 1,y = 2,z = 3,則表達(dá)式 y+=z--/++x的值是:(a)A.3.5 B.3 C.4 D.5 A.equals()方法判定引用值是否指向同一對象 B.==操作符判定兩個(gè)不同的對象的內(nèi)容和類型是否一致 C.equal()方法只有在兩個(gè)對象的內(nèi)容一致時(shí)返回true D.類File重寫方法equals()在兩個(gè)不同的對象的內(nèi)容和類型一致時(shí)返回true

      6、如果一個(gè)對象僅僅聲明實(shí)現(xiàn)了cloneable接口,但是不聲明clone方法,外部能夠調(diào)用其clone方法嗎?(b)A.能 B.不能 C.不確定

      7、下列說法錯(cuò)誤的有(bd)

      A. 能被java.exe成功運(yùn)行的java class文件必須有main()方法

      B. J2SDK就是Java API

      C. Appletviewer.exe可利用jar選項(xiàng)運(yùn)行.jar文件

      D. 能被Appletviewer成功運(yùn)行的java class文件必須有main()方法

      8、下列正確的有(acd)

      A. call by value不會(huì)改變實(shí)際參數(shù)的數(shù)值

      B. call by reference能改變實(shí)際參數(shù)的參考地址

      C. call by reference不能改變實(shí)際參數(shù)的參考地址

      D. call by reference能改變實(shí)際參數(shù)的內(nèi)容

      9、下列說法錯(cuò)誤的有(bcd)

      A. 數(shù)組是一種對象

      B. 數(shù)組屬于一種原生類

      C. int number=[]={31,23,33,43,35,63}

      5、下面的哪些敘述為真:(d)

      D. 數(shù)組的大小可以任意改變

      10、不能用來修飾interface的有(ad)

      JAVA筆試題

      A.private B.public C.protected D.static

      11、關(guān)于Float,下列說法正確的是(a)

      A.Float是一個(gè)類 B.Float在java.lang包中 C.Float a=1.0是正確的賦值方法

      D.Float a= new Float(1.0)是正確的賦值方法

      12、下列哪種說法是正確的(d)

      A. 實(shí)例方法可直接調(diào)用超類的實(shí)例方法

      B. 實(shí)例方法可直接調(diào)用超類的類方法

      C. 實(shí)例方法可直接調(diào)用其他類的實(shí)例方法

      D. 實(shí)例方法可直接調(diào)用本類的類方法

      13、下列說法錯(cuò)誤的有(c)

      A.在類方法中可用this來調(diào)用本類的類方法

      B.在類方法中調(diào)用本類的類方法時(shí)可直接調(diào)用

      C.在類方法中只能調(diào)用本類中的類方法

      D.在類方法中絕對不能調(diào)用實(shí)例方法

      14、下面說法哪些是正確的? bd

      A.Applet可以訪問本地文件

      B.對static方法的調(diào)用不需要類實(shí)例 C.socket類在java.lang中 D.127.0.0.1地址代表本機(jī) 1.public class Test1 { 2.public float aMethod(float a, float b)throws 3.IOException { } 4.} 5.public class Test2 extends Test1 { 6.//Line6 7.} 將以下(ac)方法插入行6是不合法的。

      A.float aMethod(float a, float b){} B.public int aMethod(int a, int b)throws Exception {} C.public float aMethod(float P, float q){} D.public int aMethod(int a, int b)throws IOException {}

      16、關(guān)于以下程序段,正確的說法是:(b)

      1.String s1 = “abc” + “def”;2.String s2 = new String(s1);3.if(s1.equals(s2))4.System.out.println(“.equals()succeeded”);5.if(s1 == s2)6.System.out.println(“== succeeded”);A.行4與行6都將執(zhí)行 B.行4執(zhí)行,行6不執(zhí)行 ??

      15、類Test1、Test2定義如下:

      C.行6執(zhí)行,行4不執(zhí)行 D.行

      4、行6都不執(zhí)行

      JAVA筆試題

      17、下面程序的執(zhí)行結(jié)果為:(a)

      1.public class Test { 2.static Boolean foo(char c){ 3.System.out.println(c);4.return true;5.} 6.public static void main(String[] args){ 7.int i = 0;8.for(foo(‘A’);foo(‘B’)&&(i<2);foo(‘C’)){ 9.i++;10.foo(‘D’);11.} 12.} 13.} A.ABDCBDCB B.ABCDABCD C.Compilation fails C.An exception is thrown at runtime

      18、閱讀下面的程序

      1.public class Outer { 2.public void someOuterMethod(){ 3.//Line3 4.} 5.public class Inner(){} 6.public static void main(String[] args){ 7.Outer o = new Outer();8.//Line8 9.} 10.} Which instantiates is an instance of Inner?(c)

      A.new Inner();// At line3 B.new Inner();// At line 8 C.new o.Inner();// At line 8 C.new Outer.inner();// At line 8

      19、選出能正確賦值的: public class TestA { private int a;return m;public int change(int m){

      } } public class TestB extend TestA{ public int b;public static void main(){ TestA aa = new TestA();int k;

      TestB bb = new TestB();

      } } 在Line13處可以正確賦值的有:(d)// Line 13

      JAVA筆試題

      A.k= m;B.k=b;C.k=aa.a;D.k=bb.change(30);E.k=bb.a 20、已知如下代碼: switch(m){ case 0: System.out.println(“Condition 0”);case 1: System.out.println(“Condition 1”);case 2: System.out.println(“Condition 2”);case 3: System.out.println(“Condition 3”);break;default: System.out.println(“Other Condition”);} 當(dāng) m 的值為什么時(shí)輸出 “Condition 2”?(abc)A.0 B.1 C.2 D.3 E.4 F.None

      21、給出程序段

      public class Parent { public int addValue(int a,int b){ int s;s=a+b;return s;} } class Child extends Parent{} 可以加在Child類的方法有:(cd)A.int addValue(int a,int b){} B.public void addValue(int a,int b){} C.public int addValue(int a){} D.public int addValue(int a,int b){}

      22、下述哪些說法是正確的?(d)A.實(shí)例變量是類的成員變量

      B.實(shí)例變量是用static關(guān)鍵字聲明的 C.方法變量在方法執(zhí)行時(shí)創(chuàng)建 D.方法變量在使用之前必須初始化

      23、對于下列代碼:

      public class Sample{

      long length;

      public Sample(long l){ length = l;}

      public static void main(String arg[]){

      Sample s1, s2, s3;

      s1 = new Sample(21L);

      s2 = new Sample(21L);

      s3 = s2;

      long m = 21L;

      } } 下列哪些表達(dá)式返回值為'true'?(d)

      JAVA筆試題

      A.s1 = = s2;B.s2 = = s3;C.m = = s1;D.s1.equals(m)

      26、當(dāng) Frame 改變大小時(shí),放在其中的按鈕大小不變,則使用如下哪個(gè) layout?(e)A.FlowLayout B.CardLayout C.North and South of BorderLayout D.East and West of BorderLayout E.GridLayout

      27、已知如下的命令執(zhí)行 java MyTest a b c 請問哪個(gè)語句是正確的?(cd)A.args[0] = “MyTest a b c” B.args[0] = “MyTest” C.args[0] = “a” D.args[1]= “b”

      28、下面哪個(gè)語句是創(chuàng)建數(shù)組的正確語句?(ab)A.float f[][] = new float[6][6];B.float []f[] = new float[6][6];C.float f[][] = new float[][6];D.float [][]f = new float[6][6];E.float [][]f = new float[6][];30、以下關(guān)于數(shù)據(jù)庫范式的描述,哪些是錯(cuò)誤的(c)

      A.如果把多個(gè)數(shù)據(jù)項(xiàng)用一個(gè)大的 String 表示為一個(gè)字段,則不滿足

      private String name;public String getName(){ return name;} public Ball(String name){ this.name = name;} public void play(){ ball = new Ball(“Football”);

      JAVA筆試題

      System.out.println(ball.getName());} } 上面代碼是否有錯(cuò),如果有錯(cuò),錯(cuò)誤在何處? 紅處

      2、詳細(xì)解釋下面的語句: Class.class.getClass()Class與class繼承自O(shè)bject,class試題來代表java運(yùn)行時(shí)的class和interface等等 Class.class就是得到或者生成這個(gè)Class類的Class Object 而getClass()本身就是返回一個(gè)類對應(yīng)的Class Object,所以最后Class.class.getClass()最后還是返回Class Object

      7、編寫一個(gè)截取字符串的函數(shù),輸入為一個(gè)字符串和字節(jié)數(shù),輸出為按字節(jié)截取的字符串。但是要保證漢字不被截半個(gè),如“我ABC”4,應(yīng)該截為“我AB”,輸入“我ABC漢DEF”,應(yīng)該輸出為“我ABC”而不是“我ABC+漢的半個(gè)”。

      public static boolean isLetter(char c){ int k=0X80;return c/k==0?true:false;}

      public static int lengths(String strSrc){ if(strSrc==null){ return 0;} int len=0;char[] strChar=strSrc.toCharArray();for(int i=0;i

      JAVA筆試題

      public static String subString(String origin,int len){ if(origin==null || origin.equals(“")|| len<1){ return ”“;} if(len>lengths(origin)){ return origin;} byte[] strByte=new byte[len];System.arraycopy(origin.getBytes(),0,strByte,0,len);int count=0;for(int i=0;i

      }

      public static void main(String[] args){ System.out.println(”“+ subString(”我ABC漢DEF",6));}

      10、SQL問答題

      表結(jié)構(gòu):

      1、表名:g_cardapply 字段(字段名/類型/長度):

      g_applyno varchar 8: //申請單號(hào)(關(guān)鍵字)g_applydate bigint 8: //申請日期 g_state varchar 2: //申請狀態(tài)

      2、表名:g_cardapplydetail 字段(字段名/類型/長度):

      g_applyno varchar 8: //申請單號(hào)(關(guān)鍵字)g_name varchar 30: //申請人姓名 g_idcard varchar 18: //申請人身份證號(hào) g_state varchar 2: //申請狀態(tài)

      其中,兩個(gè)表的關(guān)聯(lián)字為申請單號(hào) 題目:

      JAVA筆試題

      1、查詢身份證號(hào)碼為***082的申請日期

      2、查詢同一個(gè)身份證號(hào)碼有兩條以上記錄的身份證號(hào)碼及記錄個(gè)數(shù)

      3、將身份證號(hào)碼為***082的記錄在兩個(gè)表中的申請狀態(tài)均改為07

      4、刪除g_cardapplydetail表中所有姓李的記錄

      1、select g_applydate from g_cardapply a,g_cardapplydetail b where a.g_applyno=b.g_applyno and b.g_idcard=’***082’

      2、select g_idcard,count(g_applyno)from g_cardapplydetail group by g_idcard having count(g_applyno)>2

      3、update g_cardapply a,g_cardapplydetail b set a.g_state=’07’,b.g_state=’07’ where a.g_applyno=b.applyno and b.g_idcard=’ ***082’

      4、delete from g_cardapplydetail where g_name like ‘李%’

      下載java筆試題06word格式文檔
      下載java筆試題06.doc
      將本文檔下載到自己電腦,方便修改和收藏,請勿使用迅雷等下載。
      點(diǎn)此處下載文檔

      文檔為doc格式


      聲明:本文內(nèi)容由互聯(lián)網(wǎng)用戶自發(fā)貢獻(xiàn)自行上傳,本網(wǎng)站不擁有所有權(quán),未作人工編輯處理,也不承擔(dān)相關(guān)法律責(zé)任。如果您發(fā)現(xiàn)有涉嫌版權(quán)的內(nèi)容,歡迎發(fā)送郵件至:645879355@qq.com 進(jìn)行舉報(bào),并提供相關(guān)證據(jù),工作人員會(huì)在5個(gè)工作日內(nèi)聯(lián)系你,一經(jīng)查實(shí),本站將立刻刪除涉嫌侵權(quán)內(nèi)容。

      相關(guān)范文推薦

        Java軟件開發(fā)工程師筆試題

        Java軟件開發(fā)工程師筆試題 一、選擇題(25 x 2’ = 50’) 1、 一個(gè)Java程序運(yùn)行從上到下的環(huán)境次序是() A. 操作系統(tǒng)、Java程序、JRE/JVM、硬件 B. JRE/JVM、Java程序、硬件、操作......

        軟件開發(fā)工程師(JAVA)筆試題

        軟件開發(fā)工程師(JAVA)筆試題 請?jiān)?20分鐘以內(nèi)做答 一、選擇題 1、下面哪項(xiàng)是不合法的標(biāo)識(shí)符: A. $persons B. TwoUsers C. *point D. _endline E. final 2、下列運(yùn)算符合法的......

        Java開發(fā)工程師筆試題

        Java開發(fā)工程師筆試題 一、 單項(xiàng)選擇題(每題2分,共計(jì)30分) 1. 下列哪一種敘述是正確的 (A). abstract修飾符可修飾字段、方法和類 (B). 抽象方法的body部分必須用一對大括號(hào){}......

        JAVA程序員筆試題1

        java程序員筆試題 JAVA 程序員筆試題 時(shí)間:30分鐘 試題一: 簡單描述一下什么是事務(wù)管理,事務(wù)管理中有哪些語句?姓名: 試題二: 跳出當(dāng)前循環(huán)的關(guān)鍵詞是什么?繼續(xù)本次循環(huán)的關(guān)鍵詞是......

        JAVA工程師筆試題5篇

        【程序17】 題目:猴子吃桃問題:猴子第一天摘下若干個(gè)桃子,當(dāng)即吃了一半,還不癮,又多吃了一個(gè) 第二天早上又將剩下的桃子吃掉一半,又多吃了一個(gè)。以后每天早上都吃了前一天剩下 的......

        java程序員筆試題5篇

        姓名:聯(lián)系方式:考試開始時(shí)間: Java程序員筆試題 一、單項(xiàng)選擇題(共10題,每題2分,共20分) 1. 下列說法哪一個(gè)是正確的。( B ) A.Java程序經(jīng)編譯后會(huì)產(chǎn)生machine code B.Java程序經(jīng)編譯后......

        JAVA工程師筆試題(答案版)

        JAVA工程師筆試題 一、選擇題 1、如下代碼 public class Test { public int aMethod { static int i = 0; i++; return i; } public static void main (String args......

        騰訊JAVA工程師筆試題(5篇)

        1.Java是從( B )語言改進(jìn)重新設(shè)計(jì) A Ada B C++ C Pascal D BASIC 2.下列語句哪一個(gè)正確( B ) A Java程序經(jīng)編譯后會(huì)產(chǎn)生machine code B Java程序經(jīng)編譯后會(huì)產(chǎn)生byte code C......