getDeclaredMethods() retrieves all methods declared in a class.
getDeclaredMethods() is a reflection API method that returns an array of Method objects reflecting all the methods declared by the class, regardless of their access level. This includes private, protected, and public methods, unlike getMethods(), which only includes public ones. For example, inspecting a User class in an e-commerce app could reveal methods like 'getEmail' and 'purchaseItem'.