Small Java interview questions --
Small Java interview questions --
I. What is the difference between string and stringbuffer?
Ii. What is the view, model, and controller in struts?
View)
First, Struts provides the Java class org. Apache. Struts. Action. actionform. Java developers break down this class to create form beans. This bean can be used at runtime in two ways:
-When JSP prepares relevant HTML and forms for display, JSP will access
Bean (which saves the values to be placed in the form ). These values are provided from the business logic or from the previous user input.
-When user input is returned from a Web browser, the bean verifies and saves the input for business logic or (if verification fails) to be re-displayed.
Second, Struts provides many custom JSP tags, which are easy to use but powerful in hiding information. For example, in addition to the bean name and the name of each segment in the given bean, the page designer does not need to know more information about the form bean.
Model)
Struts does not directly help model development. In struts, the state of the system model is mainly reflected by actiomform bean and value objects.
Controller)
In Struts framework, the controller is mainly actionservlet, but the operations on the business logic are mainly coordinated by the action, actionmapping, and actionforward components (maybe these components, should be divided into the business logic in the model ). Action acts as the real implementer of the control logic, while actionmapping and actionforward specify the operation direction of different business logic or processes.
3. How to instantiate the map interface?
4: What is the difference between map and hashmap?
5. How to obtain the current system date and time?
6. What is the difference between list and arraylist?
What is WC command in Linux? (Note not the restroom)
WC (Word Count)
Function Description: calculates the number of words.
Syntax: WC [-CLW] [-- help] [-- version] [file...]
Note: The WC command can be used to calculate the number of bytes, number of words, or number of columns of a file. If the file name is not specified, or the given file name is "-", the WC command reads data from the standard input device.
Parameters:
-C or -- bytes or -- chars only displays the number of bytes.
-L or -- lines only displays the number of columns.
-W or -- words only show words.
-- Help Online Help.
-- Version: displays the version information.