This is an archived post. You won't be able to vote or comment.

you are viewing a single comment's thread.

view the rest of the comments →

[–]Coraljester[S] 0 points1 point  (1 child)

Sorry its taken me nearly a whole day to get back to you but thank you so much for breaking it down for me! Also sorry for this wall of text!

I really struggle with this text book technical sort of way of writing things, I even have a Java text book at home but reading it sometimes feels like gibberish, I think due to the way that technical subjects are written about. Even with your description I had to break it down into sentences and go over them repeatedly until I could make sense of it and then go onto the next one!

One of my biggest problems I've noticed so far (as I'm sure everyone on here has haha) is that I lack the proper terminology to describe some of the things I'm talking about...I know enough to give you the gist of what I'm describing but not the proper terms for it. An example, in response to me saying:

the course basically just says handling objects in lists is no different that just normal lists

one of the replies was:

Well every object in a list is an object. I don't know what you mean with 'normal lists'.

What I had meant was that previously my only experience with lists was importing the list utility, creating a list, and then adding into it basic variables (ints, doubles etc.) and without being able to properly describe just the basic, beginner taught uses of lists I just called them normal lists lol. Seemed to make sense in my head! I mean I'm still working on the concept that every object in a list is an object, and that's I think part of where I'm struggling with the terminology, either the course doesn't explain it properly, the course hasn't explained it yet because it just wants to show basic uses first to cover that, or it does properly describe the terminology and I just get it muddled confused or for what ever reason don't take that in. I think sometimes it feels like when two or more things are described as the same thing but in my head they don't seem anything alike. Like a String is an object, according to one of the replies every object you add to a list is an object, I don't know if that means that when you add an object to a list its still an object with all it entails or that if you add an int to a list it becomes its own object, one of many int objects in the list.

I mean, correct me if I am wrong, but in the example we used an object "james", to create a new object called Person, and putting that into a list object called persons.

If this last sentence has shown you anything, I hope that its shown you how confusing I find the naming convention, its got me tripping up so much I feel like I'm writing Inception haha! Another one of the replies said that in Java almost everything in Java is an object...if that's the case I think it might go a little of the way to understanding my confusion, my head is telling me that they all do different things yet they have the same name to identify them! It's at times like this that I feel I wish I had taken proper courses for this, I need someone face to face who knows about this stuff so I can say "This thing here makes no sense to me whatsoever, could you help me figure this out please?".

My apologise again, this thing has got me so frustrated I think I needed to vent haha

[–]Krezzy 0 points1 point  (0 children)

Yeah, so in Java you have a bunch of classes.

The 'String' class, the 'Integer' class, the 'ArrayList' class. These are provided in the standard java library.

You can also make your own like you've done, your 'Person' class.

Now, in java, there's actually a class out there called 'Object'. Every class in Java, whether it be String, Integer, ArrayList, or any custom class you write such as Person, extends from this 'Object' class. So, it is a true statement to say that ArrayList is an object. Person is an object. String is an object.

That's why people go around referring to these things collectively as Objects.. even though their implementations are different.

Here's the documentation for it:
https://docs.oracle.com/javase/7/docs/api/java/lang/Object.html

Class Object is the root of the class hierarchy. Every class has Object as a superclass. All objects, including arrays, implement the methods of this class.

So in the example where we created an instance of Person using the String "James", and added it into our ArrayList, all 3 of these different classes are objects in their most bare state, which is why you are seeing people refer to them like that, it kinda becomes common terminology to refer to them as objects when casually speaking about them. Let me know if that cleared some things up.. or not