Different between private & public method in custom class

Hi…there…

Okay just a quick shoot here…okay let’s say I have this sample class


class TestPrivate{
    
    public function TestPrivate(){};
    
    private function getGo(){
        trace("can execute");
    }
    
}


and then after instantiate I just calling the method…for testing the “public” and “private” keyword purposing only…


import TestPrivate;

var obj1 = new TestPrivate();
obj1.getGo();


the result is still can be execute eventhough I put the private keyword in front of the methods…

so what’s the private keyword stands for actually…I thought it prevent been get accessed from outside …hope someone will clearify to me…tq again…