#include "Foo.H" using namespace std; void Foo::setNum(int num) { if ( num > 0 ) { // if negative throw an exception this->num = num; } else { throw IllegalArgumentException(); } } int Foo::getNum() { return this->num; }