In addition to Weibo, there is also WeChat
Please pay attention
WeChat public account
Shulou
2025-02-25 Update From: SLTechnology News&Howtos shulou NAV: SLTechnology News&Howtos > Internet Technology >
Share
Shulou(Shulou.com)06/01 Report--
This article mainly explains "what are the written test questions for Java". Interested friends may wish to have a look. The method introduced in this paper is simple, fast and practical. Now let the editor take you to learn "what are the written test questions for Java"?
The following error in the description of IoC in the Spring feature is ()
The relationship between programs is directly controlled by the program code.
B, the so-called "control inversion" refers to the transfer of control from the application code to the external container, that is, the transfer of control.
Cminute IOC moves the responsibility of control creation into the framework, separating it from the application code.
D, when using the IoC container of Spring, you only need to indicate the objects required by the component, and at run time, the IoC container of Spring will provide it with XML configuration data.
Correct answer: a
Answer: IOC (Inversion of Control, abbreviated as IoC) is an important object-oriented programming rule to reduce the coupling of computer programs, and it is also the core of the lightweight Spring framework. Control inversion is generally divided into two types, dependency injection (DI) and dependency lookup (Dependency Lookup).
The following statement about spring dependency injection is wrong ()
A, there are usually two types of dependency injection: set value injection and construction injection:
B, construction injection can determine the injection order of dependencies in the constructor, and priority injection of dependencies
C, when the set value injection and the construction injection exist at the same time, the construction injection is performed first, and then the setting injection is performed.
D, setting value injection means that the IoC container uses the setter method of the property to inject the dependent instance. This injection method is relatively simple and intuitive.
Correct answer: C
Answer parsing: when using constructor dependency injection, Spring ensures that all dependent objects of an object are instantiated before the object is instantiated. When using the set method dependency injection, Spring first instantiates the object and then instantiates all dependent objects.
When the set value injection and the construction injection exist at the same time, the set value injection is performed first, and then the construction injection is performed.
What is LinkedHashSet ()
A, is a HashSet that preserves the order in which objects are inserted
B, is a HashSet with the performance of a linked list
C, is a HashSet that can be easily converted into a linked list
D, superclass of HashSet object
Correct answer: a
Answer analysis:
LinkedHashSet is an "extended version" of HashSet. HashSet does not care about the order, except that LinkedHashSet maintains the "insert order". HashSet internally uses the HashMap object to store its elements, while LinkedHashSet internally uses the LinkedHashMap object to store and process its elements.
The following statement is correct ()
a. Two public-decorated classes can exist in a file at the same time
b. Constructors can be overridden (override)
c. Subclasses cannot access properties that are not public and protected decorated by the parent class
D.final-decorated classes can be inherited
Correct answer: C
Answer analysis:
There can be at most one public class in a Java source file. When there is a public class, the source file name must match it, otherwise it cannot be compiled. If there is no public class in the source file, there is no consistency requirement between the file name and the class. As for main (), you don't have to put it in the public class to run the program.
Overriding is when the subclass inherits the parent class and modifies the method of the parent class. The method name, parameters, and return value must be the same. Methods marked as final cannot be overridden. If you cannot inherit a method, you cannot override it.
About the JAVA heap, the following statement is wrong ()
a. Instances and arrays of all classes allocate memory on the heap
b. The heap memory occupied by the object is reclaimed by the automatic memory management system
c. Heap memory consists of living and dead objects, free fragments.
d. The array is assigned to the stack
Correct answer: d
First of all, the array is allocated in the heap, so the statement of D is not correct.
The structure of the Java heap: JVM's heap is a runtime data area, and instances and arrays of all classes allocate memory on the heap. It is created when JVM starts. The heap memory occupied by the object is reclaimed by the automatic memory management system, the garbage collector. Heap memory is made up of living and dead objects. Surviving objects are accessible to the application and will not be garbage collected. Dead objects are objects that are not accessible to the application and have not yet been reclaimed by the garbage collector. Until the garbage collector reclaims these objects, they occupy the heap memory space.
At this point, I believe you have a deeper understanding of "what are the written test questions of Java?" you might as well do it in practice. Here is the website, more related content can enter the relevant channels to inquire, follow us, continue to learn!
Welcome to subscribe "Shulou Technology Information " to get latest news, interesting things and hot topics in the IT industry, and controls the hottest and latest Internet news, technology news and IT industry trends.
Views: 0
*The comments in the above article only represent the author's personal views and do not represent the views and positions of this website. If you have more insights, please feel free to contribute and share.
Continue with the installation of the previous hadoop.First, install zookooper1. Decompress zookoope
"Every 5-10 years, there's a rare product, a really special, very unusual product that's the most un
© 2024 shulou.com SLNews company. All rights reserved.