Can not reference class in java -


class myclass {    int value; } public myclass test(){    myclass mc;    mymethod(mc, 100);    if (mc!=null) {       mc = mc.value;       return mc;    }    return mc; } public int mymethod(myclass mc, int a) {    mc.value = + 10;    return mc; } 

i want make mc reference. if objective-c similar this:

public myclass test(){    myclass *mc;    mymethod(&mc, 100);  } 

please me. answer appreciate. thank in advanced.

in java use reference variables instead of pointers. see this , this

class myclass  {    int value;  /*all methods have belong class*/  public myclass test() {  /*myclass mc; don't need pass assign value value   assigned data members of object(reference variable) calls  function*/         myclass mc = mymethod(100); return mc; }  public myclass mymethod(int a)  {    value = + 10;    return this; //this 'this' return current object } } 

Comments

Popular posts from this blog

Delphi XE2 Indy10 udp client-server interchange using SendBuffer-ReceiveBuffer -

Qt ActiveX WMI QAxBase::dynamicCallHelper: ItemIndex(int): No such property in -

Enable autocomplete or intellisense in Atom editor for PHP -