r/javahelp • u/Nix-X • Jul 22 '20
"Pointer" in java?
Was learning Recursion from GeeksforGeeks, when I came across this code snippet -
static void abc(char *s)
{
if(s[0] == '\0')
return;
abc(s + 1);
abc(s + 1);
System.out.print(s[0]);
} In Java, we have “references”, and not an actual “Pointer” type, by which we can go in to a memory address in the JVM directly. So, what is a char pointer doing in Java? Unless my whole life has been a lie?
Problem link - https://www.geeksforgeeks.org/practice-questions-for-recursion-set-6/.
0
Upvotes
4
u/sinistergroupon Jul 23 '20
That’s a sloppy website