In reply to yr:
Once again, please use code tags making your code easier to read. I have added them for you.
You have created two distinct objects and only randomized one of them. When you call vlanobj.display(), vlan still has its initial value.
Have you looked at this course yet?