Below is my program....i am able to input the array...but i am unable to display it.......In second file...i made comment...where i think is th error..
Main file:
public
class add implements name {
input vl;
public add()
{
vl=new input();
}
publicvoid display(int dis)
{
System.out.println("Displaying");
System.out.println(dis);
}
publicstaticvoid main(String[] args)
{
new add();
}
}
Second File:
import
java.io.*;
public
class input {
int[] num=newint[10];
name mas;
public input()
{
int nu12=0;
for(int i=0;i<num.length;i++)
{
System.out.println("Numbers Entered [ " + i + " ] = ");
BufferedReader in=new BufferedReader(new InputStreamReader(System.in));
try {
nu12=(Integer.parseInt(in.readLine()));
System.out.println("Passing thru array");
mas.display(nu12);//This line is not executing why so...
} catch (NumberFormatException e) {} catch (IOException e) {} catch(NullPointerException e){}
}
}
}
Interface file:
public
interface name {
void display(int dis);
}