0
What I don't understand is that, it is being said that java doesn't support pointers as c++ for more security, so why is "this pointers" are used???
4 Antworten
+ 1
I think you misunderstood the use of this as an object reference in java, when we create object variables we refer to them as references or pointers because they point to the object. this is used the same way to refer to the current object you are working on. The pointers on a c++ context are not similar to "this" in java
0
Pointers allow you to modify variables by using their unique addresses. kind of like being able to change a TV channel using a remote rather than going to the actually Telly. A programming language with support for pointers has a lot more power compared to one that doesn't. This power can be used for malicious purposes. That's the simplest way I could answer you
0
I know what pointer is , java doesn't support pointers as it is said. but it still does support "this pointers" why??
0
in java's context the this is not a pointer but a reference to the class where it is used