fork download
  1. #include <iostream>
  2. using namespace std;
  3.  
  4. class S{
  5. private:
  6. static const int testValue = 5;
  7. public:
  8. static int getTestValue0(){
  9. return testValue;
  10. }
  11. static int getTestValue1(){
  12. return S::testValue;
  13. }
  14. };
  15.  
  16. int main() {
  17. cout << "Test Value is: " << S::getTestValue0() << endl;
  18. cout << "Test Value is: " << S::getTestValue1() << endl;
  19.  
  20. return 0;
  21. }
Success #stdin #stdout 0s 3456KB
stdin
Standard input is empty
stdout
Test Value is: 5
Test Value is: 5