课程: Java Memory Management: Values and References
今天就学习课程吧!
今天就开通帐号,24,700 门业界名师课程任您挑!
The problem of escaping references - Java教程
课程: Java Memory Management: Values and References
The problem of escaping references
- [Instructor] At this point, you already know what pass by reference means. We have seen this when we called the method with an object as an argument. Reference to this object was sent. And whenever the method modified this object, this meant that the object was also modified for other places in our code that we're holding the same reference. Since they are both pointing to the very same object. Whoever has the reference can access the object. So no news there, but this passing by reference is also true for returning objects from methods. Reference to the object gets sent. And this can also happen to third-party libraries in your application for example. Whenever this happens without it being your intention, we call this escaping references. Sending an object reference unintentionally with possible negative side effects. Even though this might be not too surprising to you, security breaches that this behavior of Java can cause, they might be a surprise. Let's move over to IntelliJ…
内容
-
-
-
-
-
(已锁定)
The problem of escaping references1 分钟 56 秒
-
(已锁定)
Collections and escaping references9 分钟 55 秒
-
(已锁定)
Avoiding escaping collection references6 分钟 36 秒
-
(已锁定)
Example custom objects: References on the loose2 分钟 9 秒
-
(已锁定)
Avoiding escaping references3 分钟 9 秒
-
(已锁定)
Solution: Fixing an escaping reference58 秒
-
(已锁定)
-
-