fork download
  1. #include <iostream>
  2.  
  3. using namespace std;
  4.  
  5. class clsContoh{
  6. private:
  7. int a;
  8. public:
  9. void setData(int b){
  10. a=b;
  11. }
  12. void getData(void){
  13. cout<<a;
  14. }
  15. };
  16. int main() {
  17. clsContoh objContoh;
  18. objContoh.setData(100);
  19. objContoh.getData();
  20. return 0;
  21. }
Success #stdin #stdout 0.01s 2724KB
stdin
Standard input is empty
stdout
100