No matter where I read private variables cannot be accessed whereas public variables can be then why not make public as global and private as local whats the difference? whats the real use of public and private ? please dont say it can be used by everyone, I suppose why not we use some conditions and make the calls ?
I hope you don't ever want more than one string in your application. I also hope that your local variables persist between function calls. These things might be the same in terms of accessibility but in terms of lifetime and other usage? They're absolutely not the same.