A REF CURSOR is basically a data type for creating Cursor variables. A cursor variable can be associated with different queries at run-time. The primary advantage of using cursor variables is their capability to pass result sets between sub programs like stored procedures, functions, packages etc.
Here is a simple example to implement REF CURSOR in PL/SQL programming.
First create a Procedure with REF CURSOR as IN OUT Parameter.
CREATE OR REPLACE PROCEDURE rc_proc (rc_data IN OUT SYS_REFCURSOR)
OPEN rc_data FOR
SELECT col1, col2
Then declare a Variable of REF CURSOR type. Run the procedure created above with the variable as Parameter.
VARIABLE rc REFCURSOR
Then print the cursor variable which will print the results from the SQL used in the procedure.
There are lot of examples in java2s.com website.