-
Notifications
You must be signed in to change notification settings - Fork 962
Java Questions #95
Comments
Expanding the question: How would you compare two objects to check for different types of equality?Equality can mean many things, but primarily in computer science there are two ways to check for equality with Objects:
By ValueChecking equality by value means to see if the second Object stores an equivalent value. In Java this is done with the By ReferenceChecking equality by reference means to see if the second Variable resolves to the same Object in memory. In Java this is done on Objects with |
Otherwise the other option is to add tags for languages and put this as an example in each with the differences per language highlighted against a 'base' language(probably JavaScript since this is a full stack resource) |
Thanks for pointing this out @skatcat31 We have discussed this in the early days of 30 seconds of interviews and there were mixed opinions on this topic. In general, this is a great idea. It makes sense to have different answers for different programming languages. However, our interview question database is not very big ~80 questions. Personally, I am against adding material that is not in the scope of modern full-stack web development for now. Mainly because, as I said, we have ~80 questions and it is not worth it. |
I was recently in an interview where I was asked "What is the difference between .equals and == when comparing Objects in Java?" that I thought would be a good example to highlight here. I do however want to think of the best way to go about it. To that end I've thought of two problems with it currently that should be addressed before submission:
The text was updated successfully, but these errors were encountered: