Reem Javaid920 Points
A few questions AND feedback!
hope someone can help me:
1) shouldn't it be in this order: final public static int MAX_PEZ = 12; similar to: final private String characterName;
2) What is an INSTANCE Variable? What is an INSTANCE? Is it the Object, in this case, the dispenser?
3) What is %d?
The Java Basics course was a breeze, but now I'm finding it difficult to grasp the material. There are so many terms used in the one video that it makes it difficult for me to keep up with what the instructor is saying. Getting really discouraged at this point! Is it just me? Should I keep going?
Jason Thomas11,736 Points
An access modifier i.e. "public" or "private" will typically be first.
public static final int MAX_UNITS = 25;
I would go back and review then keep going, or go to another resource and then come back and keep going...or both. But don't give up. Persistence pays off and some ideas just take a bit longer to solidify.
Steve Lewin6,691 Points
For #3, the %d is just like the %s, where s is for string but d is for whole numbers like int. %f is also used for floats (i.e. doubles)
Anthony Albertorio21,632 Points
Think of the "class" as a blueprint for an object, say a house plan in a new suburb. The "instance" is the particular cookie cutter house built on 1st Ave and Main St.
The properties aka fields of the house will be different depending on the house and who buys it. Its location will be different, how many bedrooms, square footage, the potential owner. These are all things we pass into the class when we create a new instance of the class. But what a house is, its main features and what its functions do not change.
The same can be said for a car. All cars for the most part have an engine, four wheels, steering wheel, seats, etc. However, there are certain features that each brand might have different, like color, size, amount of seats, horsepower, brand name, etc. Those would be instances of the car class.
Hope this helps.