Java Written test question 001

Source: Internet
Author: User
Tags log4j

One of the questions in the Java written test face



1, Struts1 in Actionform and action belongs to the MVC layer, why?

Answer: Actionform and action belong to the MVC model layer, action is used to process business logic, actionform save user form data to facilitate passing between different pages. The model layer in MVC is the business Logic layer, which is used to implement detailed 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 have to handle. is a serious problem in situations where recovery is not impossible but very difficult. For example, memory overflow, it is impossible to expect the program to handle this situation. Exception indicates that an exception that needs to be captured or handled by the program is a design or implementation problem; It indicates that the program is assumed to be performing properly. From the situation that never happens.


3, log4j is an open source project of Apache organization, through LOG4J, can specify the destination of log information output, such as console, file, etc.

Log4j The logging level mechanism, write out the log output level in the order of output levels from low to high.

Answer: log4j is divided into off, FATAL, ERROR, WARN, INFO, DEBUG, all or the level you define. LOG4J recommends using only four levels. Priority levels from high to low are ERROR, WARN, INFO, DEBUG, respectively. By defining the level here, you can control the switch to the corresponding level of log information in your application. For example, if the info level is defined here, the log information for all debug levels in the application will not be printed.



-----------------------3-course questions per day-----------------------





Java Written test question 001

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.