Java test interview question 001 and java test question 001

Source: Internet
Author: User

Java test interview question 001 and java test question 001

One of the Java test questions



1. Which layer does actionform and action belong to MVC in Struts1? Why?

A: actionform and action belong to the Model layer of MVC. Action is used to process business logic. actionform stores user form data for transmission between different pages. The model layer in MVC is the business logic layer, which is used to implement specific business logic, State maintenance and management.


2. What is the difference between error and exception?

Answer:

Error indicates system-level errors and exceptions that the program does not need to handle. It is a serious problem in the case that recovery is not impossible but difficult; for example, memory overflow, it is impossible to expect the program to handle such a situation; exception indicates the exceptions that need to be captured or processed by the program, which is a design or implementation problem; that is, it indicates that if the program runs normally, never happen.


3. Log4J is an open-source project organized by Apache. Through Log4J, you can specify the log information output destination, such as console and file. Log4J uses the log level mechanism. Write the log output level in the descending order of the output level.

A: Log4J is divided into OFF, FATAL, ERROR, WARN, INFO, DEBUG, and ALL, or your defined level. We recommend that you use only four levels of Log4j. The priority ranges from high to low: ERROR, WARN, INFO, and DEBUG. By defining the level here, you can control the switch to the corresponding level of log information in the application. For example, if the INFO level is defined here, all DEBUG-level logs in the application will not be printed.



----------------------- Three interview questions each day -----------------------





Copyright Disclaimer: This article is an original article by the blogger and cannot be reproduced without the permission of the blogger.

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.