In addition to Weibo, there is also WeChat
Please pay attention
WeChat public account
Shulou
2025-01-16 Update From: SLTechnology News&Howtos shulou NAV: SLTechnology News&Howtos > Internet Technology >
Share
Shulou(Shulou.com)06/01 Report--
This article mainly explains "what are the Java web interview questions". The explanation in the article is simple and clear, and it is easy to learn and understand. Please follow the editor's train of thought to study and learn "what are the Java web interview questions"?
What are the advantages and disadvantages of 148Jax?
Advantages:
1, the biggest point is that the page is not refreshed, the user experience is very good.
2. Communicate with the server asynchronously, which has the ability to respond more quickly.
3. We can transfer the work of some previous servers to the client, make use of the idle ability of the client to deal with it, reduce the burden of the server and bandwidth, and save space and broadband rental costs. And reduce the burden on the server, ajax's principle is to "fetch data on demand", which can minimize the burden of redundant requests and responses on the server.
4. Based on standardized and widely supported technology, there is no need to download plug-ins or Mini Program.
Disadvantages:
1. Ajax does not support browser back button.
2. Security issues AJAX exposes the details of interacting with the server.
3. The support for search engine is weak.
4. Destroy the exception mechanism of the program.
5. It is not easy to debug.
What is the difference between 149Jax application and traditional Web application?
In traditional Javascript programming, if you want to get the information on the server-side database or file, or send the client-side information to the server, you need to establish a HTML form and then GET or POST data to the server side. Users need to click the "Submit" button to send or receive data information, and then wait for the server to respond to the request and reload the page.
Because the server returns a new page each time, traditional web applications can be slow and unfriendly.
Using AJAX technology, you can make Javascript interact directly with the server through the XMLHttpRequest object.
Through HTTP Request, a web page can send a request to the web server and accept the information returned by the web server (without reloading the page). The same page is displayed to the user, and the user feels that the page is refreshed and can not see the sending request and receiving response from the Javascript backend. The experience is very good.
What is the implementation process of 150J Ajax?
(1) create a XMLHttpRequest object, that is, create an asynchronous invocation object.
(2) create a new HTTP request and specify the method, URL and authentication information of the HTTP request.
(3) set the function that responds to the state change of the HTTP request.
(4) send HTTP request.
(5) get the data returned by the asynchronous call.
(6) use JavaScript and DOM to realize local refresh.
To be specific:
1, create a XNLHttpRequest object
(regardless of ie) XMLHttpRequest request = new XMLHttprequest ()
2. Create a new Http request
XMLHttprequest.open (method,url,flag,name,password)
3. Set the function that responds to the change of Http request
XMLHttprequest.onreadystatechange=getData
Function getData () {
If (XMLHttprequest.readyState==4) {
Get data
}
}
4. Send http request
XMLHttprequest.send (data)
5. Get the object returned by the asynchronous call
, function (data) {
/ / after the asynchronous submission, the interaction is successful, and the returned data is the object returned by the asynchronous call, which is of type string.
}
6. Use js and DOM to achieve local refresh
MyDiv [XSS _ clean] =''this is the refreshed data''
151, briefly talk about the three paradigms of the database?
The first paradigm: every field of a database table is inseparable
Second normal form: non-primary attributes in database tables depend only on primary keys
The third normal form: there is no transfer function dependency of non-principal attributes on keywords.
What is the 152jaw Java collection framework? Name some of the advantages of the collection framework?
There are collections in every programming language, and the original version of Java included several collection classes: Vector, Stack, HashTable, and Array.
With the widespread use of collections, Java1.2 proposes a collection framework that includes all collection interfaces, implementations and algorithms. Java has a long history of using generics and concurrent collection classes while ensuring thread safety. It also includes blocking interfaces and their implementation in Java concurrent packages.
Some of the advantages of the collection framework are as follows:
(1) use core collection classes to reduce development costs instead of implementing our own collection classes.
(2) with the use of strictly tested collection framework classes, the code quality will be improved.
(3) by using the collection classes that come with JDK, the cost of code maintenance can be reduced.
(4) reusability and operability.
What are the basic interfaces of the 153century Java collection framework?
Collection is the root interface at the collection level. A collection represents a set of objects, which are its elements. The Java platform does not provide any direct implementation of this interface.
Set is a collection that cannot contain repeating elements. This interface models the abstraction of a mathematical set and is used to represent a collection, like a deck of cards.
List is an ordered collection that can contain repeating elements. You can access any element through its index. List is more like an array of dynamically transformed lengths.
Map is an object that maps key to value. A Map cannot contain duplicate key: each key can map at most one value.
Some other interfaces are Queue, Dequeue, SortedSet, SortedMap, and ListIterator.
154. what are the advantages of generics in the collection framework?
Java1.5 introduces generics, which are heavily used by all collection interfaces and implementations. Generics allow us to provide an object type that can be accommodated for the collection.
Therefore, if you add any other type of element, it will make an error in the compilation time. This avoids ClassCastException at run time, as you will get an error message at compile time.
Generics also make the code neat, and we don't need to use explicit conversions and instanceOf operators. It also benefits the runtime because bytecode instructions for type checking are not generated.
What is the difference between 155dre enumeration and Iterator interface?
Enumeration is twice as fast as Iterator and uses less memory. Enumeration is very basic and meets the basic needs.
However, Iterator is more secure than Enumeration because when a collection is being traversed, it prevents other threads from modifying the collection.
Iterators replace Enumeration in the Java collection framework. Iterators allow callers to remove elements from the collection, which Enumeration cannot. To make its functionality clearer, the iterator method name has been improved.
What's the difference between 156 ListIterator and Iterater?
1. We can use Iterator to traverse the Set and List collections, while ListIterator can only traverse the List.
2Magee Iterator can only traverse forward, while LIstIterator can traverse in both directions.
3Gore ListIterator inherits from the Iterator interface, and then adds some additional functions, such as adding an element, replacing an element, and getting the index position of the preceding or subsequent elements.
157, how do we sort a set of objects?
If we need to sort an array of objects, we can use the Arrays.sort () method. If we need to sort a list of objects, we can use the Collection.sort () method.
Both classes have an overloaded method sort () for natural sorting (using Comparable) or standards-based sorting (using Comparator).
Collections uses array sorting internally, and both of them have the same performance, except that Collections takes time to convert lists to arrays.
What are the best practices related to the Java collection framework?
1, select the correct collection type as needed. For example, if the size is specified, we will choose Array instead of ArrayList. If we want to traverse a Map based on the insertion order, we need to use TreeMap. If we don't want to repeat it, we should use Set.
Some collection classes allow you to specify the initial capacity, so if we can estimate the number of storage elements, we can use it to avoid re-hashing or resizing.
3, programming based on interface rather than implementation, which allows us to easily change the implementation later.
4. Always use type-safe generics to avoid ClassCastException at runtime.
5. By using the immutable classes provided by JDK as the key of Map, you can avoid implementing hashCode () and equals () yourself.
6. Use Collections utility classes whenever possible, or get read-only, synchronized, or empty collections instead of writing your own implementation. It will provide code reusability, which is more stable and maintainable.
159, what is a transaction?
Transaction is the basic unit of recovery and concurrency control.
Four basic characteristics of transaction
Atomicity, consistency, isolation, persistence
Atomicity is similar to consistency, which means either all succeed or fail.
Consistency means that from one consistency state to another consistency state
Isolation means that the execution of one transaction cannot be disturbed by another transaction.
Persistence means that once a transaction is committed, its changes to the data in the database should be permanent and immutable.
Thank you for your reading, the above is the content of "what are the Java web interview questions?" after the study of this article, I believe you have a deeper understanding of what the Java web interview questions have, and the specific use needs to be verified in practice. Here is, the editor will push for you more related knowledge points of the article, welcome to follow!
Welcome to subscribe "Shulou Technology Information " to get latest news, interesting things and hot topics in the IT industry, and controls the hottest and latest Internet news, technology news and IT industry trends.
Views: 0
*The comments in the above article only represent the author's personal views and do not represent the views and positions of this website. If you have more insights, please feel free to contribute and share.
Continue with the installation of the previous hadoop.First, install zookooper1. Decompress zookoope
"Every 5-10 years, there's a rare product, a really special, very unusual product that's the most un
© 2024 shulou.com SLNews company. All rights reserved.