Count Number of binary strings(Test case is not passing)?

import java.util.*;

public class CountBinarys {

public static void main(String[] args) {
	// TODO Auto-generated method stub

	Scanner scn = new Scanner(System.in);
	
	int t = scn.nextInt();
	
	while(t-->0)
	{
	int n = scn.nextInt();
	
	System.out.println(count(n));
	}
		
}

public static int count(int n)
{
    if(n==0)
    return 0;
	int ones[]=new int[n];
	int zeros[]=new int[n];
	
	ones[0]=1;
	zeros[0]=1;
	for(int i=1;i<n;i++)
	{
		zeros[i]=zeros[i-1]+ones[i-1];
		ones[i]=zeros[i-1];
	}

	int res = ones[n-1]+zeros[n-1];
	return res;
}

}

Looks good to me. DP relation and base case are alright. Let me check

@animesh
just use long wherever you have used int.
For some testcases, it may go above 10^9.