![]() |
|
|
|
| ||||||
|
Welcome to the The ProgrammersTalk Community forums. You are currently viewing our boards as a guest which gives you limited access to view most discussions and access our other features. By joining our free community you will have access to post topics, communicate privately with other members (PM), respond to polls, upload content and access many other special features. Registration is fast, simple and absolutely free so please, join our community today! If you have any problems with the registration process or your account login, please contact contact us. |
![]() |
![]() | | LinkBack | Thread Tools | Display Modes | ![]() |
| |||
| 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); } |
| |
| The Following User Says Thank You to HelloWorld For This Useful Post: | ||
TeraTask (09-05-2007) | ||
![]() |
| Thread Tools | |
| Display Modes | |
| |