Math, asked by Amansingh7436, 1 year ago

Difference between pointer variable and reference variable

Answers

Answered by Sneha0018
0
A pointer is just like an int: a number. It happens to be a number that identifies a memory location, and if something is stored in that memory location you can call it an address. Like an int, a pointer can be stored in a variable. A variable that stores a pointercould be called a pointer variable.

A reference variable is declared to be of a specific type and that type can never be changed. Reference variables can be declared as static variables, instancevariables, method parameters, or localvariables. A reference variable that is declared as final can't never be reassigned to refer to a different object.
Similar questions