Author: saqibkhan
-
Pattern Class
Introduction The java.util.regex.Pattern class represents a compiled representation of a regular expression. Class declaration Following is the declaration for java.util.regex.Pattern class − Learn Java in-depth with real-world projects through our Java certification course. Enroll and become a certified expert to boost your career. Field Following are the fields for java.util.regex.Duration class − Class methods Sr.No Method & Description 1 static Pattern compile(String regex)Compiles the…
-
MatchResult Interface
Introduction The java.util.regex.MatchResult interface represents the result of a match operation. This interface contains query methods used to determine the results of a match against a regular expression. The match boundaries, groups and group boundaries can be seen but not modified through a MatchResult. Interface declaration Following is the declaration for java.util.regex.MatchResult interface − Learn Java in-depth with real-world projects through…
-
Capturing Groups
Capturing groups are a way to treat multiple characters as a single unit. They are created by placing the characters to be grouped inside a set of parentheses. For example, the regular expression (dog) creates a single group containing the letters “d”, “o”, and “g”. Capturing groups are numbered by counting their opening parentheses from…
-
Overview
Java provides the java.util.regex package for pattern matching with regular expressions. Java regular expressions are very similar to the Perl programming language and very easy to learn. A regular expression is a special sequence of characters that helps you match or find other strings or sets of strings, using a specialized syntax held in a…
-
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…