Generic pointers can be declared withvoid - Java

Q.  Java: Generic pointers can be declared with__________
- Published on 29 Jun 15

a. auto
b. void
c. asm
d. None of these

ANSWER: void
 
When a variable is declared as being a pointer to type void it is known as a generic pointer. We cannot have a void type of variable so the pointer will not point to any data and therefore it cannot be dereferenced. Still it is a pointer and to use it you just need to cast it to another kind of pointer.

Post your comment / Share knowledge


Enter the code shown above:
 
(Note: If you cannot read the numbers in the above image, reload the page to generate a new one.)