i dont know whats wrong with this program...the compiler compiles the program but when i run it it shows:
johnrambo@ubuntu:~/Desktop$ java lora
Exception in thread "main" java.lang.NumberFormatException: null
at java.lang.Integer.parseInt(Integer.java:443)
at lunda.l2read(lora.java:24)
at lora.main(lora.java:124)
class lunda{
String[] la=new String[2048];
String[] lb=new String[2048];
int[] lvalid_a=new int[2048];
int[] lvalid_b=new int[2048];
int[] lage_a=new int[2048];
int[] lage_b=new int[2048];
int lhit=0;
int lmiss=0;
String s1;
String s2;
int lindex;
String ls1;
String ls2;
String ruba;
public String l2read(String s)
{
String ls1=s.substring(0,14);
String ls2=s.substring(14,25);
int lindex=Integer.parseInt(s2,2);
for(int i=0;i<2048;i++)
{
lvalid_a[i]=0; //initialising array ot 0//
lvalid_b[i]=0;
}
if(lvalid_a[lindex]==0&& lvalid_b[lindex]==0)
{
la[lindex]=ls1;
lvalid_a[lindex]=1;
lage_a[lindex]=1;
String ruba="0";
}
if(lvalid_a[lindex]==0&& lvalid_b[lindex]==1)
{
if(ls1==lb[lindex])
{
lage_b[lindex]++;
String ruba="1";
}
else
{
la[lindex]=s1;
lvalid_a[lindex]=1;
String ruba="0";
}
}
if(lvalid_a[lindex]==0&& lvalid_b[lindex]==1)
{
if(ls1==la[lindex])
{
lage_a[lindex]++;
String ruba="1";
}
else
{
lb[lindex]=s1;
lvalid_b[lindex]++;
String ruba="0";
}
}
if(lvalid_a[lindex]==1&&lvalid_b[lindex]==1)
{
if(ls1==la[lindex])
{
lage_a[lindex]++;
String ruba="1";
}
else if(ls1==lb[lindex])
{
lage_b[lindex]++;
String ruba="1";
}
else
{
if(lage_a[lindex]>=lage_b[lindex])
{
la[lindex]=ls1;
lage_a[lindex]=1;
lage_b[lindex]++;
}
else
{
lb[lindex]=s1;
lage_b[lindex]=1;
lage_a[lindex]++;
}
String ruba="0";
}
}
return ruba;
}
}
public class lora
{
public static void main(String[] args) throws Exception
{
String s;
s="10101010101000000011111001100111";
lunda x=new lunda();
String g=x.l2read(s);
System.out.println(g);
}
}