There are no pointers in java.
What you have in java are variables.
In your case there are 4 variables in your program:
The variable "sc" of type Scanner, the variable "name" of type String and the variables "firstname" and "lastname" of type String.
You are supposed to extract 2 substrings from the variable "name" and store these in the variables "firstname" and "lastname". To get these substrings I would recommend reading the String API (google for "java doc String") and choose the methods you want to use.
If you need any further information about the basics of java perhaps you should read a few online tutorials or books.