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