全英文面试题(Java软件工程师).docx_第1页
全英文面试题(Java软件工程师).docx_第2页
全英文面试题(Java软件工程师).docx_第3页
全英文面试题(Java软件工程师).docx_第4页
全英文面试题(Java软件工程师).docx_第5页
免费预览已结束,剩余3页可下载查看

下载本文档

版权说明:本文档由用户提供并上传,收益归属内容提供方,若内容存在侵权,请进行举报或认领

文档简介

Java软件工程师面试题Circle one or more options which are correct.1. Why would someone want to use JavaScript on a Web page? (5 scores)A. To react to events that occur with Web page useB. To read and write HTML C. To validate data in a Web formD. To pass data to a Java applet programE. To run a clock or timer in a Web page2. Evaluate the following String method uses by writing the value of s after the evaluation (5 scores)(write one value on the line to the right of each evaluation)var str=Mix and MatchA. s = str.indexOf(x) _2B. s = str.indexOf(g) _-1C. s = str.indexOf(M) _0D. s = str.lastIndexOf(a) _9E. s = str.indexOf(and) _43. How can someone properly open a second Web browser window with a JavaScript statement?(5 scores)A. document.openWin(/)B. openWindow(/) C. window.open(“/”)D. document.open(/) E. document.location(/)4. Given the following valid HTML form, how would you assign the value typed into the owner control to a variable ssn in a JavaScript statement?(5 scores) A. ssn = window.SSN.owner.value;B. ssn = document.SSN.owner.value;C. ssn = document.SSN.input.value;D. ssn = document.form.input.value;E. ssn = window.owner.value;5. After a JavaScript function runs the following two lines of code, what value does the variable x contain?(5 scores)arr = new Array(5);x = Math.random() / arr.length;A. a floating point number between 0.0 and 0.2B. a floating point number between 0.0 and 0.25C. a floating point number between 0.0 and 1.0D. a floating point number between 0.0 and 5.0E. x would not be assigned due to one or more errors in the code6. What is the value of variable x after the following block of JavaScript code is run? (5 scores)x=0;y=2;while(y0.5 | y0.0) x = x+1; y = y/x - y;A. 0B. 1C. more than 1D. undetermined since the code divides by zeroE. less than 17. What will happen when you attempt to compile and run this code? (5 scores)abstract class Base abstract public void myfunc(); public void another() System.out.println(Another method); public class Abs extends Base public static void main(String argv) Abs a = new Abs(); a.amethod(); public void myfunc() System.out.println(My Func); public void amethod() myfunc(); A The code will compile and run, printing out the words My FuncB The compiler will complain that the Base class has non abstract methodsC The code will compile but complain at run time that the Base class has non abstract methodsD The compiler will complain that the method myfunc in the base class has no body, nobody at all to looove it8. Which most closely matches a description of a Java Map? (5 scores)A. A vector of arrays for a 2D geographic representationB. A class for containing unique array elementsC. A class for containing unique vector elementsD. An interface that ensures that implementing classes cannot contain duplicate keys9. What will happen when you attempt to compile and run the following code? (5 scores)public class StrEqpublic static void main(String argv) StrEq s = new StrEq(); private StrEq() String s = Marcus; String s2 = new String(Marcus); if(s = s2) System.out.println(we have a match); else System.out.println(Not equal); A. Compile time error caused by private constructorB. Output of we have a matchC. Output of Not equalD. Compile time error by attempting to compare strings using =10. What will happen when you attempt to compile and run the following code? (5 scores)import java.io.*;class Base public void amethod()throws FileNotFoundExceptionpublic class ExcepDemo extends Base public static void main(String argv)ExcepDemo e = new ExcepDemo(); public void amethod() protected ExcepDemo()try DataInputStream din = new DataInputStream(System.in); System.out.println(Pausing); din.readByte(); System.out.println(Continuing); this.amethod();catch(IOException ioe) A. Compile time error caused by protected constructorB. Compile time error caused by amethod not declaring ExceptionC. Runtime error caused by amethod not declaring ExceptionD. Compile and run with output of Pausing and Continuing after a key is hit11. What will happen when you attempt to compile and run this program? (5 scores)public class Outerpublic String name = Outer;public static void main(String argv) Inner i = new Inner(); i.showName(); /End of main private class Inner String name =new String(Inner); void showName() System.out.println(name); /End of Inner classA. Compile and run with output of OuterB. Compile and run with output of InnerC. Compile time error because Inner is declared as privateD. Compile time error because of the line creating the instance of Inner12. What will be output by the following line? (5 scores)System.out.println(Math.floor(-2.1);A. -2B. 2.0C. -3D. -3.013. What will happen when you attempt to compile and run the following code? (5 scores)int Output=10;boolean b1 = false;if(b1=true) & (Output+=10)=20) System.out.println(We are equal +Output); else System.out.println(Not equal! +Output);A. Compile error, attempting to peform binary comparison on logical data typeB. Compilation and output of We are equal 10C. Compilation and output of Not equal! 20D. Compilation and output of Not equal! 1014. Given the following variableschar c = c;int i = 10;double d = 10;long l = 1;String s = Hello;Which of the following will compile without error? (5 scores)A.c=c+i;B.s+=i;C.i+=s;D.c+=s;15. Given the following class definition, which of the following statements would be legal after the comment /Here? (5 scores)class InOutString s= new String(Between); public void amethod(final int iArgs) int iam; class Bicycle public void sayHello() /Here /End of bicycle class /End of amethod public void another() int iOther; A. System.out.println(s);B. System.out.println(iOther);C. System.out.println(iam);D. System.out.println(iArgs);16. Which of the following are methods of the Thread class? (5 scores)A. yield()B. sleep(long msec)C. go()D. stop()17. How would you print a text message to the browser? (5 scores)A.PrintWriter out = response.getWriter(); out.println(message);B.response.println(message);C.ServletOutputStream out = response.getWriter(); out.println(message);D.ServletOutputStream out = response.ServletOutputStream(); out.println(message);18. Which of the following will include the text of a resource at translation time? (5 scores)A.B.C.D.19. What is the correct syntax for assigning a value to a beans property? (5 scores)A.B.C.D.20. How do you get the request header names? (5 scores)A.Enumeration e = request.getHeaderNames ;B.String names = request.getHeaderNames ;C.Enumeration e = request.getHeaders ;D.String names = request.getHeaders ;21. How do you perform programmatic server-side includes? (5 scores)A.setForward(String url)B.RequestDispatcherC.RequestD.getResource(String url)22. What happens if, when calling getParameterValues, the parameter has a single value? (5 scores)A.It returns an error. You should use the getParameterValue method for single value parameters.B.It returns an array with a length of one.C.getParameterValues calls getValue for that single value.D.getParameterValues calls getValue for that single value.23. Read the following code:public void service(HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException response.setContentType(text/html); PrintWriter out = response.getWriter(); out.println(); out.println(Servlet Error Handling + Example); out.println(); out.println(A skimpy, but complete servlet.); out.println(); out.println(); Which two statements are true regarding this code (choose two)?(5 scores)A. The doGet, doPost, or doPut method is called next depending on the type of request.B. This code is invalid because it doesnt call one of the doGet, doPost, or doPut methods.C. This code is valid and will handle all three types of HTTP requests including GET, POST, and PUT.D. The next method invoked is destroy.24. You normally write a servlet by overriding the doPut, doGet, and doPost methods. Which class do they come from? (5 scores)A.HttpServletRequestB.HttpServletResponseC.HttpServletD.HttpSession25. Which interface defines the methods for retrieving form parameters? (5 scores)A.ServletRequestB.ServletResponseC.HTTPRequestD.HTTPResponse26. Given the following deployment descriptor code: test TestServlet color green Which methods can be used to access a servlet initialization parameter color? (5 scores)A.Servlet.getInitParameter()B.HttpServletRequest.getParameter()C.ServletContext.getInitParameter()D.ServletConfig.getInitParame

温馨提示

  • 1. 本站所有资源如无特殊说明,都需要本地电脑安装OFFICE2007和PDF阅读器。图纸软件为CAD,CAXA,PROE,UG,SolidWorks等.压缩文件请下载最新的WinRAR软件解压。
  • 2. 本站的文档不包含任何第三方提供的附件图纸等,如果需要附件,请联系上传者。文件的所有权益归上传用户所有。
  • 3. 本站RAR压缩包中若带图纸,网页内容里面会有图纸预览,若没有图纸预览就没有图纸。
  • 4. 未经权益所有人同意不得将文件中的内容挪作商业或盈利用途。
  • 5. 人人文库网仅提供信息存储空间,仅对用户上传内容的表现方式做保护处理,对用户上传分享的文档内容本身不做任何修改或编辑,并不能对任何下载内容负责。
  • 6. 下载文件中如有侵权或不适当内容,请与我们联系,我们立即纠正。
  • 7. 本站不保证下载资源的准确性、安全性和完整性, 同时也不承担用户因使用这些下载资源对自己和他人造成任何形式的伤害或损失。

评论

0/150

提交评论