Wednesday 15 May 2013

java - Getting a object reference in interface that was not passed -


At present, the code below gives compile annotations, because the audience does not know what SMS task is for the SMS Task in the listener Should be an example. Is it possible to do this without passing in it? If this happens, then it seems like a redundant:

  .createTask (SMS Tasks, New Functional Listener {SMS}} {...}   

The current code :

  Public Zero Dustof () {Smartphone Task SMSTesk = Create SMSTyc (); SuperGetsSystem (). CreateTask (SMT Task, New Task Complex Listener) {@ Override Public Wide On Tesk Complaint () {Release Resource (SMSTask); // Error}}}}}} Private Smartphone Tasks vs. SMSTask () {Return new Smartphone Task}}   

createTask:

  Zero create otask (Smartphone Tasks, Functional Listener Listener) << Code   

You can specify the variable last :

  Last Smartphone Task smsTask = createSMSTask ();    

No comments:

Post a Comment