Learn about attributes for class declaration in java, we have the largest and most updated attributes for class declaration in java information on alibabacloud.com
method name and argumentsMethod[] GetMethods ()Returns all array of methods with the public propertyMethod Getdeclaredmethod (String name, class[] params)Returns a specific method (without public and non-public attributes), based on the method name and parametersMethod[] Getdeclaredmethods ()Returns an array of all methods in the class (without public and non-pu
also desirable to add flexibility when specifying the method to be timed. I initially java.util.regex implemented this by using regular expression matching support in the Java 1.4 package, and realized that it didn't really bring the kind of flexibility I wanted. The problem is that the meaningful pattern types used to select the classes and methods to be modified do not fit well with the regular expression model.So what kind of patterns make sense f
In-depth understanding of Java Virtual Machines: The process of class loadingClass starts from being loaded into the virtual machine's memory, and its entire lifecycle includes: load, validate, prepare, parse, initialize, use, and unload seven phases , until the memory is unloaded. The process of loading , validating, preparing, parsing, and initializing five stages of the
Features of the JAVA sub-parent class and java features
I. variables (attributes)This indicates the reference of the current object. this variable is first found in this class. If it is not found, it will be found in the parent class.Super is used to access the current objec
of the constructorConstructor GetConstructors ()Returns an array of all constructors with the public propertyConstructor getdeclaredconstructor (class[] params)Returns a concrete constructor (without public and non-public attributes) based on the parameters of the constructorConstructor getdeclaredconstructors ()Returns all the constructor arrays in the class (w
current virtual machine specification has defined more than 200 instructions.
Exception_table_length and exception_table each represent the exception information for the method.
Attributes_count and Attribute_info represent the number of attributes and the property sheet in the code attribute, and from here you can see that the property sheet is flexible in the file structure of class, which can exist in
ConceptClass can be seen as a template for creating Java objects.Classes are objective, abstract, and conceptual things.The class keyword must be used to indicate that this is a class.Since it is a class, java allows the class to be free from public keyword constraints. Of c
, the following items areAccess flag 0x0002, indicating acc_privateName_index:0x0005, indicating Mdescriptor_index:0x0006, which means I, intattributes_count:0x0000, the number of attributes is 0That is, a field of privateint mMethodThe next two bytes 0x0002, representing the number of methods is 2, according to the structure of the method table, the following items areThe first methodAccess flag 0x0001, indicating acc_publicName_index:0x0007, said De
1. The role of ClassLoader, in general, is to load and load the compiled class into machine memory, in order to provide prerequisites for subsequent execution of the program.2. Considerations arising from a program:In the middle of the wind, the teacher in his video gave us a program, claiming to be all the world's Java programmers will make mistakes.The general conclusion is that a=1,b=1. The reason given
Getdeclaredmethod (String name, class[] params)Returns a specific method (without public and non-public attributes), based on the method name and parametersMethod[] Getdeclaredmethods ()Returns an array of all methods in the class (without public and non-public properties)3. Gets the member variable (member property) of the classThere are four ways to get member
the advantages of using inner classes for this instance, but if father, mother are not interfaces, but abstract classes or concrete classes. This time we can only use the inner class to achieve multiple inheritance.
The great advantage of using an inner class is that it solves multiple inheritance problems very well, but if we don't need to solve multiple inheritance problems, we can naturally use other en
[Java reflection mechanism] _ reflection Application -- get the structure notes of the class
Objectives of this chapter:You can use reflection to obtain all the Implemented interfaces.You can use reflection to obtain the parent class inherited by a class.You can use reflection to obtain all the constructor methods of a class.You can use reflection to obtain all t
Abstract class and interface are the two mechanisms in the Java language that support the definition of a class, and it is precisely because of the existence of these two mechanisms that the powerful object-oriented capabilities of Java are given, and there are similarities between them, but there are many differences
Java Utility ClassThe 1.File class provides methods for managing files and directories whose objects represent a file or directory. It provides several ways to manipulate a file or folder. The list () method and the Listfiles () method can play a role in locating a specific file.The 2.Object class, which is the ancestor of all
, but access_flags the corresponding meanings are different. The method table contains an important property: a Code property. CodeProperty Stores Java code-compiled bytecode directives, in ClassAnalyzer which the Code corresponding classes are Java shown below (only class properties are listed).
type Code struct { pool []constantpool.ConstantI
Interface
1. Because Java does not support multiple inheritance, an interface can inherit only one parent class, but multiple interfaces can be implemented. The interface itself can inherit multiple interfaces.
2. The member variables in the interface are of the public static final type by default. Initialization that must be displayed.
3. All methods in the interface are public abstract by default. I
variable (member property) of the classThere are four ways to get member propertiesField GetField (String name)Returns a specific member variable with the public property, based on the variable nameField[] GetFields ()Returns an array of member variables with the public propertyField Getdeclaredfield (String name)Returns a member variable (without public and non-public attributes), based on the variable nameField[] Getdelcaredfields ()Returns an arra
argumentsMethod[] GetMethods ()Returns all array of methods with the public propertyMethod Getdeclaredmethod (String name, class[] params)Returns a specific method (without public and non-public attributes), based on the method name and parametersMethod[] Getdeclaredmethods ()Returns an array of all methods in the class (without public and non-public properties)
by the object can be recycled.
During the running of the program, only sporadic garbage collection will be performed. It is not simple because some objects no longer need to be recycled, different Java runtime implementations use different methods for garbage collection.
6. Overload methods.
The same class defines two or more methods that share the same name, as long as their parameter
with the public propertyMethod Getdeclaredmethod (String name, class[] params)Returns a specific method (without public and non-public attributes), based on the method name and parametersMethod[] Getdeclaredmethods ()Returns an array of all methods in the class (without public and non-public properties) 3. Gets the member variable (member property) of the class
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.