Java face question (in) 1, write a bubble sorting algorithmAscending order:Int[] Nums = {5,6,9,10,20,30,28,27,15};for (int i = 0;ifor (int j = 0;jint temp = 0;if (Nums[i]Temp=nums[i];NUMS[I]=NUMS[J];Nums[j]=temp;}}}descending order Nums[i] Nums[i]>nums[j]2. How JQuery obtains an element with ID id3(1) Introduction of jquery jar Package(2) refer to the jar package to the page, if the JS file is obtained, T
integer is the object, which points to the object with a reference. When you need to put something in the arraylist,hashmap, such as the int,double type is not put in, because the container is loaded with object, this is the need for these built-in type of outer covering class. Each of the built-in types in Java has a corresponding overlay class.8, the difference between the run-time exception and the general exceptionJava provides two main types of
Collections.synchronizedmap (.. ) to synchronize the HashMap.Using the ConcurrenthashmapThe preferred choice between these two options is to use Concurrenthashmap, because we do not need to lock the entire object and get the lock through the Concurrenthashmap partition map.The difference between 10.IdentityHashMap and HashMapIdentityhashmap is the implementation of the map interface. Different from HashMap, the reference equality is used here.In HashMap if two elements are equal, then Key1.equa
LinkedList, and if you need to quickly randomly access elements, you should use ArrayList.
If the program is in a single-threaded environment, or if access is done only in one thread, it is more efficient to consider non-synchronous classes, and if multiple threads may operate on a class at the same time, the synchronized classes should be used.
Pay special attention to the operation of the hash table, and the object as key should correctly replicate the Equals and Hashcode methods.
managed by the automatic garbage collector of the Java Virtual machine.Java memory model: According to the instructions in Java Language specification, there is a main memory in the JVM system (main memories or Java Heap memory), and all object members in Java Variables are stored in main memory and are shared for all
controller. The controller invokes the corresponding view to display the results of the processing. and presented to the user through a view.2. Why SSH is used in the project(1) The use of Struts2 is because Struts2 is based on the MVC pattern, the application is very good layering, so that developers focus on the implementation of business logic; second, struts has a wealth of taglib, such as flexible use, can greatly improve the development efficiency.(2) Hibernate: Hibernate provides an easy
noteWrittenFor questions about what is the difference between the two, try to use a clear format, such as a form, to answerInterviewInterviewer said the topic you may not understand what it means, such as I was asked this question, "What is the prototype of Java Reference", at the beginning of the blindfolded, quoting I understand, prototype I understand, but the reference of the prototype??? What the heck.. At this time you do not say do not know, y
numbers. The efficiency should be as high as possible, use the extra space to be as small as possible, say the idea.Basic Java Knowledge
What is the difference between a string class and a stringbuffer, and how do you convert to each other?
What are the different collection classes that Java contains, and what are the differences between ArrayList and LinkedList?
A li
.
If the program is in a single-threaded environment, or if access is done only in one thread, it is more efficient to consider non-synchronous classes, and if multiple threads may operate on a class at the same time, the synchronized classes should be used.
Pay special attention to the operation of the hash table, and the object as key should correctly replicate the Equals and Hashcode methods.
Try to return the interface rather than the actual type, such as returning a list inst
instruction is not reordered, such as the following singleton code is thread-safe:Public class Singleton3 {private static volatile Singleton3 instance = null;Private Singleton3 () {}Public static Singleton3 getinstance () {if (instance = = null) {synchronzied (singleton3.class) {if (instance = = null) {instance = new Singleton3 (); } } }return instance; }}Singleton3 uses a locking mechanism to ensure that only one instance is created in a multithreaded environment, and that two if inf
find the same data is more likely, that is, faster query speed.3), share_pool_size (SQL shared buffer pool): This parameter is the cache of the library cache and the data dictionary.4), Log_buffer (replay log buffer)5), sort_area_size (sorting area)6), processes (number of simultaneous connected processes)7), Db_block_size (Database block size): Oracle default block is 2KB, too small, because if we have a 8KB of data, then 2KB block database to read 4 times to read, and 8KB block database as lo
(data buffer zone) access to the data are placed in this area of memory, the larger the parameter, Oracle in memory to find the same data is more likely, that is, faster query speed. 3), share_pool_size (SQL shared buffer pool): This parameter is the cache of the library cache and the data dictionary. 4), Log_buffer (replay log buffer) 5), sort_area_size (sorting area) 6), processes (number of simultaneous connected processes) 7), Db_block_size (Database block size): Oracle default block is 2KB
load Java extension libraries. The implementation of the Java virtual machine provides an extension library directory. The class loader finds and loads Java classes in this directory.3. Systems Class Loader (System class loader): It loads Java classes based on the Java appl
consider using the StringBuffer class directly when you need to append strings. Reference answer:The String class is an immutable class, where the string value cannot be changed once it is initialized. StringBuffer is a mutable string class, string-like buffer that can modify the value of a string .3 The difference between StringBuffer and StringbiulderStringBuffer is a thread-safe string buffer, and StringBuilder is not thread-safe .Back to top 4 type of wrapper?The wrapper class includes byte
the read operation because the object and write operation is not the same object, read between the need to lock, the synchronization between read and write only after writing through a simple "=" To point a reference to a new array object, which hardly takes time, so that the read operation is very safe, suitable for use in multi-threading, never concurrentmodificationexception, So copyonwritearraylist is suitable for scenarios where read operations are much larger than write operations, such a
1, final, finally, finalize the differenceFinal-are modifiers that can modify variables, methods, and classes.The final class can no longer derive a new subclass that is not a parent class;The final variable must be given the initial value at the time of declaration or assigned in the constructor method, and can only be read in subsequent references and cannot be modified.The final method cannot be overloaded.The finally-provides a finally block during exception handling to perform the closing o
and write operation is not the same object, read between the need to lock, the synchronization between read and write only after writing through a simple "=" To point a reference to a new array object, which hardly takes time, so that the read operation is very safe, suitable for use in multi-threading, never concurrentmodificationexception, So copyonwritearraylist is suitable for scenarios where read operations are much larger than write operations, such as caching.8. The difference between it
occupied, it is locked, and the thread attempts to take ownership of the monitor while executing the monitorenter instruction, as follows:
If the monitor has an entry number of 0, the thread enters monitor and then sets the entry number to 1, which is the owner of the Monitor.
If the thread already occupies the monitor, just re-enter, then enter the monitor number plus 1.
If another thread has already occupied monitor, the thread goes into a blocking state until the numbe
a new action, and an Action object corresponds to a request context.3. Because Struts2 needs to be encapsulated for each request, the variables of the servlet life cycle such as request,session are encapsulated into a single map, supplied to each action, and thread-safe, so in principle, it is more memory-intensive.4, the Interceptor implementation mechanism, STRUTS2 has its own interceptor mechanism, SPRINGMVC with the independent AOP way, so that Struts2 configuration file volume is still lar
(client proxy) and reverse proxy (server-side proxy)
CDN Implementation Principle
How to improve the system's QPS and throughput
Actual combat capability
Have you dealt with the problem on the line? There is a memory leak, a CPU utilization level, and how the application is handled without responding.
Have you encountered any technical problems in the development? How to solve the
If there is a billions of whitelist, high concurrent queries are required daily durin
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:
info-contact@alibabacloud.com
and provide relevant evidence. A staff member will contact you within 5 working days.