Tuesday, October 20, 2009

Contoh Penggunaan Private & Public Dalam Program

Private:
#include

class CONTOH{
int X; //X bersifat private
public:
void SetX(int XX){
X=XX;
}
void ShowX(){
cout<<”Nilai X :”<<

class CONTOH{
int X;
public:
void SetX(int XX){
X=XX;
}
int KuadratX ( ){
return X*X;
}
// ...
};

//Fungsi utama
int main(){


0 comments: