model = $model;
}
public function getModel() {
return $this->model;
}
}
// Create an object
$myCar = new Car();
// Accessing the public method from outside the class
$myCar->setModel(“Toyota”);
echo $myCar->getModel(); // Output: Toyota
?>