Pointers in Java

前端 未结 9 2033
梦毁少年i
梦毁少年i 2020-12-05 16:28

C++ supports pointers whereas Java does not. But when many programmers questioned how you can work without pointers, the promoters began saying \"Restricted pointers.” So we

9条回答
  •  温柔的废话
    2020-12-05 16:52

    Java has pointers. That's why it has a NullPointerException. It just doesn't have pointer math. Any reference to an object is actually a pointer, which is why it can be null. That said, there are plenty of useful programming languages which don't have pointers, so anyone who thinks that pointers are necessary for programming has a very narrow view of programming languages.

提交回复
热议问题