I have a class and a method. In the method I am calling another method of another class - Class2.Method2 The return type of method 2 is a wrapper class. What should be the variable type in my method 1 to hold this returning wrapper class from the method 2 ?

  • 1
    Please include the entire error message verbatim as well as the code snippet you use which generates the error.
    – Adrian Larson
    Aug 27 '20 at 15:55
  • It'll also be important to know whether your wrapper class is a standalone class, or an inner class of another class. You can edit your question to include those extra details (comments are temporary, limited in length, and limited in formatting options).
    – Derek F
    Aug 27 '20 at 16:04

The fully qualified type name is OuterClass.InnerClass. In your case, your outer class is WrapperClassTeest (sic) and your inner class is wrapperClass. Therefore, you would do

WraperClassTeest.WrapperClass instance = WrapperClassTTeest.methodToReturnWrapper();

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.