Category: 13. java.lang.reflect Package

  • Error

    Introduction The java.lang.reflect Error contains the error which can occur during reflection operations. Errors Summary Sr.No. Error & Description 1 GenericSignatureFormatErrorThrown when a syntactically malformed signature attribute is encountered by a reflective method that needs to interpret the generic signature information for a type, method or constructor.

  • Exceptions

    Introduction The java.lang.reflect Exceptions contains the exceptions which can occur during reflection operations. Exceptions Summary Sr.No. Exception & Description 1 InvocationTargetExceptionInvocationTargetException is a checked exception that wraps an exception thrown by an invoked method or constructor. 2 MalformedParameterizedTypeExceptionThrown when a semantically malformed parameterized type is encountered by a reflective method that needs to instantiate it. 3 UndeclaredThrowableExceptionThrown…

  • Introduction

    The java.lang.reflect Interfaces contains the interfaces which are used to obtain reflective information about classes and objects. Interface Summary Sr.No. Interface & Description 1 AnnotatedElementRepresents an annotated element of the program currently running in this VM. 2 GenericArrayTypeGenericArrayType represents an array type whose component type is either a parameterized type or a type variable. 3 GenericDeclarationA common…

  • Proxy 

    Introduction The java.lang.reflect.Proxy class provides static methods for creating dynamic proxy classes and instances, and it is also the superclass of all dynamic proxy classes created by those methods. Class declaration Following is the declaration for java.lang.reflect.Proxy class − Learn Java in-depth with real-world projects through our Java certification course. Enroll and become a certified expert to boost your career. Fields Following…

  • Modifier 

    Introduction The java.lang.reflect.Modifier class provides static methods and constants to decode class and member access modifiers. The sets of modifiers are represented as integers with distinct bit positions representing different modifiers. The values for the constants representing the modifiers are taken from the tables in sections 4.1, 4.4, 4.5, and 4.7 of The Java Virtual Machine Specification.…

  • Method 

    Introduction The java.lang.reflect.Method class provides information about, and access to, a single method on a class or interface. The reflected method may be a class method or an instance method (including an abstract method). A Method permits widening conversions to occur when matching the actual parameters to invoke with the underlying method’s formal parameters, but it throws…

  • Field 

    Introduction The java.lang.reflect.Field class provides information about, and dynamic access to, a single field of a class or an interface. The reflected field may be a class (static) field or an instance field. A Field permits widening conversions to occur during a get or set access operation, but throws an IllegalArgumentException if a narrowing conversion would occur.…

  • Constructor

    Introduction The java.lang.reflect.Constructor class provides information about, and access to, a single constructor for a class. Constructor permits widening conversions to occur when matching the actual parameters to newInstance() with the underlying constructor’s formal parameters, but throws an IllegalArgumentException if a narrowing conversion would occur. Class declaration Following is the declaration for java.lang.reflect.Constructor class − Learn Java in-depth with real-world projects…

  • reflect – Array

    Introduction The java.lang.reflect.Array class provides static methods to dynamically create and access Java arrays. Array permits widening conversions to occur during a get or set operation, but throws an IllegalArgumentException if a narrowing conversion would occur. Class declaration Following is the declaration for java.lang.reflect.Array class − public final class Array extends Object Learn Java in-depth with real-world projects through our Java certification…

  • AccessibleObject 

    Introduction The java.lang.reflect.AccessibleObject class is the base class for Field, Method and Constructor objects. It provides the ability to flag a reflected object as suppressing default Java language access control checks when it is used. The access checks for public, default (package) access, protected, and private members are performed when Fields, Methods or Constructors are used to…