classes and objects

C++ Classes and Objects 0

C++ Classes and Objects

Program 1 // Class and Object #include<iostream> using namespace std; class Student { private: int rno; string name; string course; double cgpa; public: void getData(); void putData(); }; void Student::getData() { cout<<“\nEnter Roll No:...

Python Classes and Objects 0

Python Classes and Objects

Program 1 # Classes and Object in Python class Test: # Member method def display(self): print(“Welcome in OOPS”) #calling T=Test() T.display() Program 2 # Classes and Object in Python # class Test: # def...

PHP OOP Classes and Objects 0

PHP OOP Classes and Objects

Program 1 <?php class MyClass { public $m,$n,$r; // instacne function add() { echo “<center>”; $this->r=$this->m + $this->n; echo “Addition is”.$this->r; echo “</center>”; return $this->r; } function sub() { echo “<center>”; $this->r=$this->m – $this->n;...