What are the differences and how does have an effect on the program and the programmer?
Objects are complex data types, primitives are err primitive :P
Objects you can create yourself whilst primitives are a standard part of the language.
When hes talking about references in Java think of a reference as a remote and the object as a tv. You might be able to control the tv with a remote but its not the actual tv.
Therefore If you use an == on an object it wont work as its actually comparing the address of the remote and not the object.
In C++ you can easily see this by doing: object1 = object2. The old object1 remains in memory ! this is because you just changed the remote/reference to point to something else you didn't actually touch the object itself. Java works the same but Java will delete an object if theres no references to it.
The main confusion with references happens when passing parametres to methods.
When you pass an Object to a method its actually passing a references(remote) to your method.
When you pass a primitive to a method it passes a copy of the variable.
Hope thats cleared some stuff up.
basically primitives are stored in a direct location in memory so say for example I used the code
int myAge = 21;
The compiler would read that from a direct location in memory, i.e. the compiler would look at the memory address where myAge is stored and find the value "21"
Objects are....well.....objects. They're classes basically that incorporate a multitude of things (attributes and methods) however when you instantiate one the compiler works a bit different. So if I were to use the code
AgeObject myAge = new AgeObject(21);
I'm making a reference to that object. Basically I'm pointing to where that object is located rather than referencing it directly. So when the compiler looks at "myAge" it is effectively looking at a memory address where the relevant object is located.
Primitives are the actuall "real" data ie int age = 21;
Classes (which, upon run time, are turned into objects) are complex and they can be modelled on the real world.
I.e. in a library, a Book Class may contain, title, author etc.
A Class/Object can represent anything from the real world.
What about classes, objects, field variables, methods and state?
From what I gather a class is basically a blueprint of an object. You can have lots of different instances a class which is an object. The method is more or less the main bulk of a class and it describes its behaviours. The field variables is just basically the variables declared outside the methods i.e. the variables that are local to that class and global to all the methods in that class. The state is the variables because these variables describe what state the object is.
To me an object and a class is more or less the same thing except that an object can change its values whereas a class cannot unless you use brutal force. It's the same up to the point when you start changing one or more of it's values. I also see an object just being a variable that's been referred to the class and then that variable takes the form of that class and you can mold it any way you like.
That's my way of thinking, just to simplify it all for my lil head.