r/javahelp • • Sep 06 '15

I need help

For my assignment I need to do this....DECLARE AN INSTANCE VARIABLE CALLED NAME THAT CAN CONTAIN A VALUE SUCH AS "EGGS"....I have no idea where to start. If someone could help me get started hopefully I can finish the assignment. Thanks everyone

0 Upvotes

16 comments sorted by

View all comments

0

u/[deleted] Sep 06 '15

[deleted]

3

u/desrtfx Out of Coffee error - System halted Sep 06 '15

private int getAisle; private double getCost;

They are wrong.

Your assignment clearly calls them aisleNum and cost.

The get prefix is used for the method that returns the value of the respective variable.

so: Variable: aisleNum -> Methods: setAisleNum and getAisleNum

You have to learn to read and follow the assignments to the point. This is also an important skill for a programmer.