Login Register






Thread Rating:
  • 0 Vote(s) - 0 Average


interfaces help filter_list
Author
Message
RE: interfaces help #21
Okay. The @override is how you override a method in Netbeans. Override simply means that the method is inherited but you don't want to use the inherited code, you want to use your own code which you provide.

Next, what is the scope of the name variable? is it local or an instance variable? If its local in another method you can't use it in a different method.

Lastly, since you did an override on toString() I'm not sure if you can use it in the same manner. You may have to use it as a regular method (i.e. toString(purchasePrice);

This seems weird because from what you are saying you need to create a toString() when one already exists.

Maybe you can choose a different method name other than toString but use toString() in that method. You will get the result you need without the headache and without overriding toString().

Reply





Messages In This Thread
interfaces help - by blackeagle - 11-25-2013, 11:51 PM
interfaces help - by blackeagle - 11-25-2013, 11:51 PM



Users browsing this thread: 4 Guest(s)