国产激情久久久久影院小草_国产91高跟丝袜_99精品视频99_三级真人片在线观看

JAVA英文面試題目

時(shí)間:2021-02-10 15:07:30 求職英語 我要投稿

JAVA英文面試題目

  1. How could Java classes direct program messages to the system console, but error messages, say to a file?.

JAVA英文面試題目

  The class System has a variable out that represents the standard output, and the variable err that represents the standard error device. By default, they both point at the system console. This how the standard output could be re-directed:

  Stream st = new Stream(new FileOutputStream("output.txt")); System.setErr(st); System.setOut(st);

  2. What's the difference between an interface and an abstract class?

  A. An abstract class may contain code in method bodies, which is not allowed in an interface. With abstract classes, you have to inherit your class from it and Java does not allow multiple inheritance. On the other hand, you can implement multiple interfaces in your class.

  3. Why would you use a synchronized block vs. synchronized method?

  A. Synchronized blocks place locks for shorter periods than synchronized methods.

  4. Explain the usage of the keyword transient?

  A. This keyword indicates that the value of this member variable does not have to be serialized with the object. When the class will be de-serialized, this variable will be initialized with a default value of its data type (i.e. zero for integers).

  5. How can you force garbage collection?

  A. You can't force GC, but could request it by calling System.gc(). JVM does not guarantee that GC will be started immediately.

  6. How do you know if an explicit object casting is needed?

  A. If you assign a superclass object to a variable of a subclass's data type, you need to do explicit casting. For example:

  Object a; Customer b; b = (Customer) a;

  When you assign a subclass to a variable having a supeclass type, the casting is performed automatically.

  7. What's the difference between the methods sleep() and wait()

  A. The code sleep(1000); puts thread aside for exactly one second. The code wait(1000), causes a wait of up to one second. A thread could stop waiting earlier if it receives the notify() or notifyAll() call. The method wait() is defined in the class Object and the method sleep() is defined in the class Thread.

  8. Can you write a Java class that could be used both as an applet as well as an application?

  A. Yes. Add a main() method to the applet.

  9. What's the difference between constructors and other methods?

  A. Constructors must have the same name as the class and can not return a value. They are only called once while regular methods could be called many times.

  10. Can you call one constructor from another if a class has multiple constructors

  A. Yes. Use this() syntax.

  11. Explain the usage of Java packages.

  A. This is a way to organize files when a project consists of multiple modules. It also helps resolve naming conflicts when different packages have classes with the same names. Packages access level also allows you to protect data from being used by the non-authorized classes.

  12. If a class is located in a package, what do you need to change in the OS environment to be able to use it?

  A. You need to add a directory or a jar file that contains the package directories to the CLASSPATH environment variable. Let's say a class Employee belongs to a package com.xyz.hr; and is located in the file c:/dev/com/xyz/hr/Employee.java. In this case, you'd need to add c:/dev to the variable CLASSPATH. If this class contains the method main(), you could test it from a command prompt window as follows:

  c:/>java com.xyz.hr.Employee

  13. What's the difference between J2SDK 1.5 and J2SDK 5.0?

  A.There's no difference, Sun Microsystems just re-branded this version.

  14. What would you use to compare two String variables - the operator == or the method equals()?

  A. I'd use the method equals() to compare the values of the Strings and the == to check if two variables point at the same instance of a String object.

  15. Does it matter in what order catch statements for FileNotFoundException and IOExceptipon are written?

  A. Yes, it does. The FileNoFoundException is inherited from the IOException. Exception's subclasses have to be caught first.

  16. Tell me a little about yourself?

  A.I am holding a master degress in software science and had 2-year work experience in software development. I have used J2EE technology for 2 years,including Jsp,servlet,javabean,XML,EJB,I also used C language for half year and IBM mainframe technology half year and IBM mainframe technology half year.And the projects I participated in follow the Waterfall model lifecycle starting from design,then coding ,testing,maintenance.

  17.Describe a situation where you had to work under pressure,and explain how you handle it.

  A.Once when we did a mainframe project,our customer wanted to see a demo from our team before they signed the contract with our company.It is urgent,because our customer didn't give us enough time to do it. So all my team menbers had to work overtime,but we finished it punctually and perfectly . Our customer was satisfied with it.Actually,It is common to meet some deadlines or work under pressure in IT field.I am ok with it.

  18.What would your last employer tell me about your work performance?

  I am sure my last employer will praise my work performance,because he was reluctant to let me go when I told him I want to quit and study abroad,and he said I am welcome to come back when I finish study.

  19.What is your major weakness?

  I always want everything to be perfect.Sometimes,I am over-sensitive. When a design pattern or technical solution comes up during a meeting discussion,I am always the first one to test the feasibility.Some leader don't like such person because sometimes it is embarrassing when I prove it doesn't work while the leader still believe it is a perfect solution,But I think I did nothing wrong about it,it is good for the company.

  20.Why did you leave your last job?

  Although I did well in the last company,I always feel the theoretical study and actual practice are equally important and depend on each other.So,I decide to further study and actual practice are equally important and dependent on each other.So,I decide to further study to extend my theory in computer science.

  21.What are your strengths?

  What I am superior to others I believe is strong interest in software development I have.Many friends of mine working in IT field are holding bachelor degree or master degree and have worked for several years,but they don't have much interest in it,they only treat what they do everything a job,a means to survive,they don't have career plan at all. I am different. I like writing programs.I have set up my career goal long time ago.I will do my best to make it possible in the future.And I have worked hard towards this goal for several years.

  22.What are your future career plans?

  I would like to be a software engineer now.but my career goal is to be an excellent software architector in the future.I like writing programs. Software is a kind of art, although sometimes it drove me crazy,after I overcame the difficulties I feel I am useful,I will keep working in IT field.

  23.What are your salary expectations?

  I believe your company will set up reasonable salary for me according to my ability,so I don't worry about it at all.

  Between 7000 to 8000 monthly

  24. Why are you interested in this position?

  Your company specializes in providing technical solutions to customers and the last company I worked in also specializes in this field. I have relevant skills and experiences meeting your requirement.

  I am sure I can do it well.

  25.Do you have any questions that you would like to ask me?

  What is a typical workday like and what would I do?

  What is your expectation for me in this job?

  26.What J2EE design patterns have you used before?

  Command/Session Facade/Service Locator/Data Access Object/Business Delegate

  27. What is the difference between an Applet and an Application?

  A Java application is made up of a main() method declared as public static void that accepts a string array argument, along with any other classes that main() calls. It lives in the environment that the host OS provides.

  A Java applet is made up of at least one public class that has to be subclassed from java.awt.Applet. The applet is confined to living in the user's Web browser, and the browser's security rules, (or Sun's appletviewer, which has fewer restrictions).

  The differences between an applet and an application are as follows:

  1. Applets can be embedded in HTML pages and downloaded over the Internet whereas Applications have no special support in HTML for embedding or downloading.

  2. Applets can only be executed inside a java compatible container, such as a browser or appletviewer whereas Applications are executed at command line by java.exe or jview.exe.

  3. Applets execute under strict security limitations that disallow certain operations(sandbox model security) whereas Applications have no inherent security restrictions.

  4. Applets don't have the main() method as in applications. Instead they operate on an entirely different mechanism where they are initialized by init(),started by start(),stopped by stop() or destroyed by destroy().

  28. What are java beans?

  JavaBeans is a portable, platform-independent component model written in the Java programming language, developed in collaboration with industry leaders. It enables developers to write reusable components once and run them anywhere -- benefiting from the platform-independent power of Java technology. JavaBeans acts as a Bridge between proprietary component models and provides a seamless and powerful means for developers to build components that run in ActiveX container applications.

  Java beans is very powerful tool you can use in your servlet/JSP bridge. You can use the servlets to build the bean and can be passed over to the JSP for reading. This provides tight encapsulation of the data while preserving the sanctity of servlets and JSP.

  29. What is RMI?

  RMI stands for Remote Method Invocation. Traditional approaches to executing code on other machines across a network have been confusing as well as tedious and error-prone to implement. The nicest way to think about this problem is that some object happens to live on another machine, and that you can send a message to the remote object and get a result as if the object lived on your local machine. This simplification is exactly what Java Remote Method Invocation (RMI) allows you to do.

  30. What gives java it's "write once and run anywhere" nature?

  Java is compiled to be a byte code which is the intermediate language between source code and machine code. This byte code is not platorm specific and hence can be fed to any platform. After being fed to the JVM, which is specific to a particular operating system, the code platform. specific machine code is generated thus making java platform. independent.

  31. How does Java inheritance work?

  A class can only directly extend one class at a time. Multiple inheritance is only allowed with regard to interfaces. A class can implement many interfaces. But a class can only extend one non-interface class.

  32. What are native methods? How do you use them?

  Native methods are used when the implementation of a particular method is present in language other than Java say C, C++.

  To use the native methods in java we use the keyword native

  public native method_a()

  This native keyword is signal to the java compiler that the implementation of this method is in a language other than java.

  Native methods are used when we realize that it would take up a lot of rework to write that piece of already existing code in other language to java.

  33. Class A subclass B subclass C. All override foo(). I cast C to A and call foo(). What happens? Can C call A->foo()?

  An instance of Class C is of type Class B and A (both). SO you can cast C to A. You CANNOT cast an instance of A to C.

  34. What does the "static" keyword mean in front of a variable? A method? A class? Curly braces {}?

  -- static variables: These are class level variable whose value remain same irrespective of the number of instances of the class.

  -- static methods:

  These are those methods that can be called without the need for creating the objects of the class i.e. they are class level methods. They can call only static methods. They cannot refer to "this" as they are not associated with any particular instance.

  -- static block: These are called before the main is called and are called only once. Subsequent invocation of the java program containing static block would not call it again. Hence, they can be used to load libraries say in native function call.

  -- Only Inner class could be declared as a "static". This declaration suppress the generation of the reference to the outer class object. 這意味著:1)為創(chuàng)建一個(gè)static內(nèi)部類的對(duì)象,我們不需要一個(gè)外部類對(duì)象;2)不能從static內(nèi)部類對(duì)象訪問一個(gè)外部類對(duì)象。

  35. How many different types of JDBC drivers are present? Discuss them.

  There are four JDBC driver types.

  Type 1: JDBC-ODBC Bridge plus ODBC Driver:

  The first type of JDBC driver is the JDBC-ODBC Bridge. It is a driver that provides JDBC access to databases through ODBC drivers. The ODBC driver must be configured on the client for the bridge to work. This driver type is commonly used for prototyping or when there is no JDBC driver available for a particular DBMS.

  Type 2: Native-API partly-Java Driver:

  The Native to API driver converts JDBC commands to DBMS-specific native calls. This is much like the restriction of Type 1 drivers. The client must have some binary code loaded on its machine. These drivers do have an advantage over Type 1 drivers because they interface directly with the database.

  Type 3: JDBC-Net Pure Java Driver:

  The JDBC-Net drivers are a three-tier solution. This type of driver translates JDBC calls into a database-independent network protocol that is sent to a middleware server. This server then translates this DBMS-independent protocol into a DBMS-specific protocol, which is sent to a particular database. The results are then routed back through the middleware server and sent back to the client. This type of solution makes it possible to implement a pure Java client. It also makes it possible to swap databases without affecting the client.

  Type 4: Native-Protocol Pure Java Driver

  These are pure Java drivers that communicate directly with the vendor's database. They do this by converting JDBC commands directly into the database engine's native protocol. This driver has no additional translation or middleware layer, which improves performance tremendously.

  36. Does Java have "goto"?

  Yes and No. There is no "goto" operator used in Java, but it is a reserved keyword, and one can use break statements to branch to a labelled statement, exactly as one would use a goto.

  37. Why "bytecode"? Can you reverse-engineer the code from bytecode?

  yes, with some tools.

  38. How does exception handling work in Java?

  1.It separates the working/functional code from the error-handling code by way of try-catch clauses.

  2.It allows a clean path for error propagation. If the called method encounters a situation it can't manage, it can throw an

  exception and let the calling method deal with it.

  3.By enlisting the compiler to ensure that "exceptional" situations are anticipated and accounted for, it enforces powerful coding.

  4.Exceptions are of two types: Compiler-enforced exceptions, or checked exceptions and Runtime exceptions, or unchecked exceptions. Compiler-enforced (checked) exceptions are instances of the Exception class or one of its subclasses -- excluding the RuntimeException branch. The compiler expects all checked exceptions to be appropriately handled. Checked exceptions must be declared in the throws clause of the method throwing them -- assuming, of course, they're not being caught within that same method. The calling method must take care of these exceptions by either catching or declaring them in its throws clause. Thus, making an exception checked forces us to pay heed to the possibility of it being thrown. An example of a checked exception is java.io.IOException. As the name suggests, it throws whenever an input/output operation is abnormally terminated.

  39. Does Java have destructors?

  Java does not have destructors. Garbage collector does this job periodically depending upon the memory requirements of the machine and on the fact that a particular object is no longer needed.But it has finalizers that does a similar job. The syntax is

  public void finalize() { }

  If an object has a finalizer, the method is invoked before the system garbage collects the object, but using finalize() does not guarantee that it would be called b4 garbage collector is invoked.

  40. What does the "final" keyword mean in front of a variable? A method? A class?

  A final variable cannot be reassigned, but it is not constant. For instance,

  final StringBuffer x = new StringBuffer();

  x.append("hello");

  is valid. X cannot have a new value in it, but nothing stops operations on the object that it refers, including destructive operations.

  Also, a final method cannot be overridden or hidden by new access specifications. This means that the compiler can choose to in-line the invocation of such a method. (I don't know if any compiler actually does this, but it's true in theory.)

  The best example of a final class is String, which defines a class that cannot be derived.

  41. Access specifiers: "public", "protected", "private", nothing?

  Public? Any other class from any package can instantiate and execute the classes and methods

  Protected? Only subclasses and classes inside of the package can access the classes and methods

  Private? The original class is the only class allowed to execute the methods.

  And in case if there is no modifier specified, it means, only the classes inside the package can access th

  42. The difference etween Vector and ArrayList

  1.ArrayList is not synchronized while Vector is.

  2.ArrayList has no defaule size while vector has a default size of 10.

  3.ArrayList don't define any increment size while Vector has.

  4.ArrayList can be seenn directly without any iterator while vector rrequices an iterator to display all it's content.

  43. The difference between Hashtable and HashMap

  The hashMap class is roughly equivalent to hashTable. except that it is unsynchronized and permits nulls. HashMap can not guarantee that the order of the Map will remain constant over time.

  44:Diference betweent inerface and abstract class

  1.interface no implementation.abstract class can have partial implementation

  2. a class can implement several interfaces but one class can only extend one abstract class.

  3.interfaces are slow as it required extra indirection to find corresponding method in the actual class.

  similarities: neither abstract classes or interface can be instantiated.


【JAVA英文面試題目】相關(guān)文章:

java英文面試筆試題03-19

世界知名公司英文面試題目03-20

海信面試英語題目03-02

java面試最常見問題10-27

java招聘面試常見問題10-27

java面試筆試題分享03-11

小升初面試筆試及面試常見題目03-17

英語面試9大面試陷阱題目03-20

華為面試代碼筆試題目03-11

電廠面試筆試題目02-12