This week's book giveaway is in the OCAJP 8 forum. We're giving away four copies of OCA Java SE 8 Programmer I Study Guide and have Edward Finegan & Robert Liguori on-line! See this thread for details.
I haven't looked lately, but I think you need to declare the attributes you're going to support. In other words, the example you used is a "do-nothing" skeleton that requires you to add stuff that makes it do something useful.
An IDE is no substitute for an Intelligent Developer.