Small Java interview questions --

Source: Internet
Author: User
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.

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: info-contact@alibabacloud.com 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.