[java] If java doesn't have pointers, how come I can get a NullPointerException? | Sololearn: Learn to code for FREE!
New course! Every coder should learn Generative AI!
Try a free lesson
+ 5

[java] If java doesn't have pointers, how come I can get a NullPointerException?

6th May 2017, 7:02 PM
Thanh Le
Thanh Le - avatar
2 Answers
+ 14
@Twelfty is right. If you don't know that Java handles the pointers for you and hides them away, then you cannot see any reasons to prefer Java over C or C++. Btw that's the reason some Java quizzes make me laugh. There are a couple of them stating that Java doesn't have pointers. They all should have been declined because that really is misleading (and teaches something wrong).
6th May 2017, 7:31 PM
Tashi N
Tashi N - avatar
+ 5
Java has pointers but hides from programmers.
6th May 2017, 7:04 PM
Twelfty
Twelfty - avatar