If you want Private data to be private, then you mark it private. By trying to access data in the main function outside the class you really don't want your data to be private but public. If you don't treat your data like it is private why should anyone else?