Java FAQ & lt; 1 & gt;, java FAQ

Source: Internet
Author: User

Java FAQ <1>: java FAQ

1. Which of the following statements is true:

A. The form parameter can be modified by the field modifier B. The form parameter cannot be object C. The form parameter is actually passed when the method is called D. The form parameter can be regarded as local. variable reference answer: D 2. The sequence set used by Java is A, ascii B, BCD C, DCB D, and Unicode) 3. What functions does the Java reflection mechanism provide? A. Determine the Class B to which an object belongs at runtime, construct the Class Object C at runtime, judge the member variables and methods of A Class D at runtime for details about how to call an object, refer: ABCD (more obvious in dynamic proxy) 4. Which of the following statements about final, finally, and fianalize are true? A and final are used to declare attributes, methods, and classes, they indicate that attributes are unchangeable, methods cannot be overwritten, and classes cannot be inherited. B. finally is a part of the structure of the exception handling statement, indicating that it is always executed. C. finalize is a method of the Object class. When the garbage collector is executed, it calls the thorn method of the recycled Object, this method can be used to collect other resources, such as closing files, when the collector collects the resources. D. After the referenced variable is modified by final, it can no longer point to other objects. The content of the object it points to is also an immutable reference answer: ABC (the final modified object in D, indicates that the reference is immutable, and the content of the object to which the reference object is directed can be changed.) 5. The difference between HashMap and HashTable is true: a. HashMap and HashTable both implement Map interfaces B. HashMap is non-synchronized, HashTable is synchronizedC, and HashTable uses Enumeration. HashMap uses IteratorD and HashTable to directly use the hashCode of the object, hashMap recalculates the hash value and is used to replace the modulo. Answer: ABCD 6. Which of the following classes are thread-safe? A, Vector B, HashMap C, ArrayList D, StringBuffer E, and Properties. For more information, see ADE 7. Which of the following is not characteristic of Java: a. Java is committed to checking program compilation and runtime errors. B. Java can run virtual machines to implement cross-platform C. Java can manipulate memory by itself to reduce the possibility of memory errors. D. Java also implements real arrays., to avoid Overwriting data types, see answer: D 8. Which of the following statements about Java class loaders are true? A. bootstrap class loader ): it is used to load the core library of Java and is implemented by using native code B. extensions class loader: it is based on the class path (CLASSPATH) of Java applications) to load Java class C and system class loder: it loads Java class D based on the Java application class path, Tomcat creates a Loader for each APP, The ClassLoader of the WebApp is saved. If you need to load the class under the WebApp, you can retrieve the ClassLoader for reference. Answer: ABCD 9. Which of the following statements about ThreadLocal are true: a. ThreadLocal inherits from TheadB and ThreadLocal to implement the Runnble Interface C. ThreadLocal. The important function is to share data among multiple threads. D. ThreadLocal uses A hash table to provide A copy of A variable for each thread. e. ThreadLocal ensures data security between threads, the data of each thread is not accessed and damaged by other threads. For details, see DE 10, Interge I = 42; Long l = 42L; Double d = 42.0. The following is true: a, I = l B, I = d C, l = d D, I. equals (d) E, d. equals (l) F, I. equals (l) G, l. equals (42L) Reference answer: G (equals compares references, = compares addresses)

Related Article

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.