First, the difference between final, finally, finalize.
Answer: final is used to declare properties, methods and classes, which respectively means that properties are immutable, methods cannot be overridden, and classes cannot be inherited. Finally is part of the exception handling statement structure, indicating that it is always executed. finalize is a method of the Object class. This method of the recycled object will be called when the garbage collector is executed. This method can be overridden to provide other resource recycling during garbage collection, such as closing files, etc.
Second, Anonymous Inner Class (Anonymous Inner Class) can extend (inherit) other classes, can it implement (implement) interface (interface)?
Answer: You can inherit other classes or complete other interfaces. This method is commonly used in swing programming.
Third, The more you can tell about the difference between Static Nested Class and Inner Class, the better (some interview questions are very general).
Answer: Static Nested Class is an inner class declared as static, which can be instantiated without relying on external class instances. Usually inner classes need to be instantiated after the outer class is instantiated.Fourth, the difference between & and &&.
Answer: & is a bitwise operator, which means bitwise AND operation, && is a logical operator, which means logical AND (and). ###
All resources on this website are contributed and published by netizens, or reprinted by major download sites. Please check the integrity of the software yourself! All resources on this website are for learning and reference only. Please do not use them for commercial purposes, otherwise you will be responsible for all consequences incurred! If there is any infringement, please contact us to delete and remove it. Contact information: admin@php.cn