Return an object to use in another method
Hi i was just wondering if it was possible to return an object to use in another method. ill explain what i mean using exarmple code:
Qestion qestion = new Qestion(...);
Answer answer = new Answer(...);
the "..." are put there to get rid of unesscerary code.
Basically i use method1 to input a qestion and create an object "qestion" of class Qestion.
Then method2 is used get input of an answer and create an object "answer" of class Answer.#
I then want to pass it back to method1 for use with the method "addAnswer" from the qestion class.
Unfortunatly this apparently doesnt work :S