Q:

how function return 2nd and 4th value using collection in oracle? answer would be 42 and 46

It will display 4th collection value. i want second and fourth.
create or replace function temp_fun_2 return number as
    TYPE t1 IS table of number;
    emp_tab t1 ;
BEGIN
    emp_tab := t1(12, 42, 39, 46, 57, 62, 11, 35, 98);
    return emp_tab(4);
end;
/

A:

Judging from your comment: 

i want output 22 and 46. one below the other

(by the way it's 42 not 22!)
I guess, that you are looking for Table functions or Pipelined Table functions
So, this should work:         
CREATE TYPE t_row AS object   (
  id           NUMBER
);
/

CREATE TYPE t_tab IS TABLE OF t_row;
/

create or replace function temp_fun_2 return t_tab PIPELINED as
    TYPE t1 IS table of number;
    emp_tab t1 ;
BEGIN
    emp_tab := t1(12, 42, 39, 46, 57, 62, 11, 35, 98);
    PIPE ROW(t_row(emp_tab(2)));
    PIPE ROW(t_row(emp_tab(4)));
    return;
end;

select * from table(temp_fun_2)

result: 
42
46

