Pessoal,
Alguém sabe me dizer pq esta dando NullPointerException nessa linha -> retorno = q.verifica(3, 1, new int[]{1,2,3}) ???
Segue:
public class Questao17 {
public static void main(String[] args) {
Questao17 q = null;
int retorno = 0;
retorno = q.verifica(3, 1, new int[]{1,2,3});
System.out.println("retorno: "+retorno);
}
private int verifica(int x,int n,int v[]){
int j = 0;
while(j<n && v[j] != x)
j += 1;
if(j < n) return 1;
else return 0;
}
}
