DEV Community

Discussion on: Does Java pass only by value?

Collapse
 
pentacular profile image
pentacular
  • "Pointers are declared using * operator and can only be assigned with an address of another variable or NULL (called Null Pointer)."

This is not quite true.

  1. The * in a declaration in C or C++ is not an operator.
  2. A pointer need not be assigned the address of a variable. Consider p = p + 1;
  3. NULL is not a pointer -- it is the null pointer constant -- an expression evaluating to something equivalent to 0 or (void *)0 -- which means that in some contexts it doesn't produce a pointer value at all.
Collapse
 
vivekworks profile image
Vivek T S

Thank you for the correction. I'll verify and update the post.

Collapse
 
pentacular profile image
pentacular

You're welcome. :)