First, the Java Foundation
1. What do you know about Java modifiers and their respective usage mechanisms? (Public, abstract, final, synchronized, super ...) )
01.public: Allow all customers to access
02.protected: Used only in this package, in this class, and in subclasses of the class
03.private: Only allowed in this class
04.abstract: No implementation is provided and the subclass is required to provide the implementation.
05.static: Related to the entire class, regardless of the individual object.
06.final:final decorated classes that cannot be inherited
Final modified method, cannot be overridden
A final modified variable cannot change its initial value.
07.synchronized: The method obtains access to object monitoring, and if the method is of type static, gain access to the class itself.
08.super: Constructors and methods, all using the keyword super to point to the superclass. But the method is different, using this keyword to execute methods in the overloaded superclass.
2. What is the difference between String, StringBuffer and StringBuilder? Describe respectively the efficiency of their implementation?
01. Difference
The main performance difference between the string type and the StringBuffer type is that the string is an immutable object, so each time a change is made to the string type, it actually equals a new string object, and then points the pointer to the new string object. Therefore, it is best not to use string to change the content of the strings, because each generation of objects will have an impact on system performance, especially when there is no reference object in memory, the JVM's GC will start to work, the speed will be quite slow.
02. Execution Speed:
Comparison of the three in the speed of execution: stringbuilder>stringbuffer>string
03, the use of the scene:
A, if you want to manipulate a small amount of data with string
B, single-threaded operation string buffer operation of large amounts of data using StringBuilder
C, multi-threaded operation string buffer operation of large amounts of data using StringBuffer
3. The difference between overloading and rewriting. Can overloaded methods change the return value type?
01. Overloading: In the same class, the same method name, but with different parameter types or numbers, is independent of the return value type. Different parameters with the same name.
02. Override: In the parent class and subclass, the method name of the method in the subclass, the number of arguments, the parameter type, is exactly the same as in the parent class, and the return value type must be the same.
What is the difference between the 4.JAVA SERVLET API forward () and redirect ()?
01.forward: Forwarding is the server behavior, when the browser does not know the source of the specific resources he requested, so the URL will not change. When forwarding, you can share the data in the request.
02.redirect: Redirection is the client behavior, the server sends a status code according to logic, tells the browser to request that address again, so the address bar shows a new URL, redirection cannot carry parameters.
5. What are the methods of parsing XML in JAVA? and describe their advantages and disadvantages.
01.DOM parsing:
is to represent the official web standards of XML documents in a platform-and language-neutral way, and analyzing the structure usually requires loading the entire document and constructing the hierarchy, before any work can be done, based on the information hierarchy.
The advantage is that because the tree is persistent in memory, you can modify it so that the application can make changes to the data and structure. It can also navigate up and down the tree at any time, rather than as a one-off process like sax. Dom is much simpler to use.
02.SAX parsing:
For extremely large documents, parsing and loading the entire document can be slow and resource-intensive, so it is better to use other means to process such data, such as the event-based model, such as sax. The advantages of this processing are very similar to the advantages of streaming media. The analysis can begin immediately, rather than waiting for all data to be processed. Also, because the application examines data only when it is being read, it does not need to store the data in memory. This is a huge advantage for large documents. In fact, the application doesn't even have to parse the entire document; it can stop parsing when a condition is met. In general, Sax is much faster than its surrogate dom.
03.JDOM parsing:
The goal is to become a Java-specific document model that simplifies interacting with XML and is faster than using DOM implementations.
04.DOM4J parsing:
It is an intelligent branch of Jdom. It incorporates a number of features beyond the basic XML document representation, including integrated XPath support, XML schema support, and event-based processing for large documents or streaming documents. It also provides the option of building a document representation, DOM4J is a very good Java XML API, features excellent performance, powerful and extremely easy to use, and it is also an open source software. Now you can see that more and more Java software is using dom4j to read and write XML, especially to mention that even Sun's JAXM is using DOM4J.
Second, JavaScript Related:
1.javascript What is the way to open a page?
01.window.open (Surl[,varguments] [, Sfeatures]) new page
02.window.showmodaldialog (Surl[,varguments] [, Sfeatures]) modal dialog box
03.window.showmodelessdialog (Surl[,varguments] [, sfeatures]) Non modal dialog box
2. How do I invoke the JS method after the page is loaded?
Body tag plus onload event, <body onload= "alert (1);" >
What is the difference between 3.innerHTML and outerhtml?
01, when using innerHTML will find the content of the element (does not contain the elements themselves)
The content of the element (including the element itself) will be found when using outerhtml.
02. Example:
<a href= "test.jsp" >test</a>,innerhtml take to test,
outerHTML take to <a href= "test.jsp" >TEST</A>.
4.javascript How to do local refresh of the page?
Use Ajax.
Principle: Gets a Request object, sends a request to the specified URL, when the request completes (status 4), gets the content returned to the request, and populates the content to the local page.
Three: Database-related
1, the difference between stored procedures and functions:
A stored procedure is a collection of user-defined sets of SQL statements that involve tasks of a particular table or other object that a user can call a stored procedure. A function is usually a method defined by a database that takes a parameter and returns a value of some type and does not involve a particular user table.
2. What is the difference between truncate and delete commands in Oracle?
The way to delete data from a table is Delete,truncate, which is to delete the data in the table and not delete the table structure
01, delete can delete the entire table of data can also delete a table in one or N to meet the criteria of the data
02, truncate can only delete the entire table of data
, we generally take the delete operation as a deletion table and the truncate operation is called truncating the table
3. What is the difference between the char and VARCHAR2 data types in Oracle? What is the difference between a data "test" stored in a field of type char (10) and VARCHAR2 (10), and its storage length and type?
01.char is a fixed-length Fu Yi type, VARCHAR2 is a variable-length character type.
"Test" is padded with a space in char (10), the storage length is 10, and the storage length in VARCHAR2 (10) is 4 bytes.
4.
If the system has the following four tables:
1) Document table (DOC): Number (DOCID), name (DocName), description (DOCDESC), DocId primary key, docname indexed;
2) Student Table (XS): Student Code (XSDM), student name (XSMC);
3) Discipline table (XK): Discipline Code (XKDM), subject name (XKMC), maximum score (ZGF);
4) score Table (CJ): Student Code (XSDM), Discipline Code (XKDM), achievement (CJ).
Issue 1: Write out keywords for your most commonly used SQL statements
01 、--data operations
select--retrieving data rows and columns from a database table
insert-- Add a new row of data to a database table
delete--delete rows of data from a database table
update--Update data in database tables,
02 、--data definition
create table--Create a database table
drop table"--Deletes tables from the database;
alter table- -Modify database table structure
、--Data Control
Grant--Granting user access
Deny--Deny user access
REVOKE--Remove user access rights
、--Transaction Control
COMMIT--End the current transaction
ROLLBACK--Abort the current transaction
SET TRANSACTION--Define the current transactional data access characteristics
Issue 2: The following query is processing speed (the same amount of data returned) from high to low?
A, select * from Doc where docname= ' test '
B, select * from Doc where docid=50
C, select * from Doc where docdesc= ' test '
b greater than a is greater than C
Question 3: List the student names (SQL statements) that have failed (< bottom 60 points):
Select Xsmcfrom xs,cj where XS. XSDM=CJ. XSDM and Cj<60
Question 4: Count each student's total score (SQL statement):
Selectxsmc,sum (CJ) from XS,CJ where XS. XSDM=CJ. XSDM GROUP by XSDM
Question 5: List the names and averages (SQL statements) of students who did not fail (>=60):
Select Xsmc,avg (CJ) from Xs,cjwhere XS. XSDM=CJ. XSDM and cj>60 GROUP by XSDM
Java Face question 01