How do Java Objects get stored in Fields?

Person

After research on Object fields, all I have found is that they get stored in that other Class.
But let's say that I'm storing a Class called Inventory on a field at Class A.

private Inventory userInventory;

That Inventory Object has the criminal record, stored in a hashmap of Crime and Date.

private HashMap<Crime, Calendar> record;

That map is changed within the Inventory like so:

public void addCrime(Crime crime, Calendar instance) {
      record.put(crime, instance);
}

My question is, the stored Inventory in the Class A's field will still be the same if I execute addCrime on it?

starkshang

Yes,Inventory object will be the same,meaning the reference will be the same as before.but its reference object's attr named record will add a new pair.

Collected from the Internet

Please contact [email protected] to delete if infringement.

edited at
0

Comments

0 comments
Login to comment

Related

From Dev

how to get the difference between 2 objects fields in java

From Dev

How do I $concat fields in an array of objects?

From Dev

How to order objects by multiple fields in Java?

From Dev

How to initialize objects in Java - with fields or with local variables?

From Dev

How to clone abstract objects with final fields in Java?

From Dev

How to initialize objects in Java - with fields or with local variables?

From Dev

How do local variables get stored in stack?

From Dev

how do i get values stored in struct?

From Dev

How to get Objects inside an Objects in java?

From Dev

How do you use java stream api to convert list of objects into a nested map based on information stored inside object?

From Dev

How do you use java stream api to convert list of objects into a nested map based on information stored inside object?

From Dev

How to check if fields values between objects (stored within an associative array) are equal?

From Dev

How do I order fields of my Row objects in Spark (Python)

From Dev

How to get other fields of objects when using aggregate and groups

From Dev

How to get all sub fields from objects that contain in ArrayList?

From Dev

How are class attributes/fields stored

From Dev

Java conccurency with database stored objects

From Dev

How to compare private data fields of objects to ensure they are the same (Java)?

From Dev

How to convert List of Objects to map using object's fields in Java

From Dev

How to do the GET method from a hashmap with objects?

From Dev

How do I get all the children objects of the children objects of an object?

From Dev

How do arrays with length defined by variables in C get stored in memory?

From Dev

How do I get checkbox as checked if value is stored in database?

From Dev

How do I get an accurate timing of a SQL Server stored procedure?

From Dev

How do I allocate array of objects in Java?

From Dev

How do I combine two objects in Java?

From Dev

How do I create multiple objects in Java?

From Dev

How do I return objects with lambdas java

From Dev

How do I compare objects in Java?

Related Related

  1. 1

    how to get the difference between 2 objects fields in java

  2. 2

    How do I $concat fields in an array of objects?

  3. 3

    How to order objects by multiple fields in Java?

  4. 4

    How to initialize objects in Java - with fields or with local variables?

  5. 5

    How to clone abstract objects with final fields in Java?

  6. 6

    How to initialize objects in Java - with fields or with local variables?

  7. 7

    How do local variables get stored in stack?

  8. 8

    how do i get values stored in struct?

  9. 9

    How to get Objects inside an Objects in java?

  10. 10

    How do you use java stream api to convert list of objects into a nested map based on information stored inside object?

  11. 11

    How do you use java stream api to convert list of objects into a nested map based on information stored inside object?

  12. 12

    How to check if fields values between objects (stored within an associative array) are equal?

  13. 13

    How do I order fields of my Row objects in Spark (Python)

  14. 14

    How to get other fields of objects when using aggregate and groups

  15. 15

    How to get all sub fields from objects that contain in ArrayList?

  16. 16

    How are class attributes/fields stored

  17. 17

    Java conccurency with database stored objects

  18. 18

    How to compare private data fields of objects to ensure they are the same (Java)?

  19. 19

    How to convert List of Objects to map using object's fields in Java

  20. 20

    How to do the GET method from a hashmap with objects?

  21. 21

    How do I get all the children objects of the children objects of an object?

  22. 22

    How do arrays with length defined by variables in C get stored in memory?

  23. 23

    How do I get checkbox as checked if value is stored in database?

  24. 24

    How do I get an accurate timing of a SQL Server stored procedure?

  25. 25

    How do I allocate array of objects in Java?

  26. 26

    How do I combine two objects in Java?

  27. 27

    How do I create multiple objects in Java?

  28. 28

    How do I return objects with lambdas java

  29. 29

    How do I compare objects in Java?

HotTag

Archive