When you are assigning variables it is the value on the LHS of the = which is set. Thus, in setbookNum() you need booknum=x
and in setbookName() you need bookname=b
The application doesn't seem to be one for which having a lot of setters and getters is sensible. After all, we don't usually change the titles of books. Consider setting these member variables in a constructor.