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.