One of the Java written test questions

Source: Internet
Author: User

One of the Java written test questions



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 realize the 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 have to handle, a serious problem in situations where recovery is not impossible but difficult, such as memory overflow, which cannot be expected to be handled by the program; exception represents an exception that needs to be captured or handled by a program, which is a design or implementation issue In other words, it means that if the program runs normally, it 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 uses the log-level mechanism to write out the log output level in 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, with the priority from high to low being ERROR, WARN, INFO, DEBUG. By defining the level here, you can control the switch to the appropriate 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-----------------------





Copyright NOTICE: This article for Bo Master original article, without Bo Master permission not reproduced.

One of the Java written test questions

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.