dimanche 22 février 2015

The terminal does not allow me to type any values




package Exer6;

import java.io.*;
import java.util.*;
import java.net.*;

public class Exercise1 {

public static void main(String[] args) {

try {
String[] split = null;
String[] cpline = null;
String[] IDNum = null;
URL ReadUrl = new URL(args[0]);
BufferedReader in = new BufferedReader(new InputStreamReader(
ReadUrl.openStream()));

String line = in.readLine();

while (line != null) {
int i = 0;
cpline[i] = line;
i++;
}

while (line != null) {
split = line.split(",");
int i = 0;
IDNum[i] = split[0];
i++;
}

Scanner scan = new Scanner(System.in);
System.out.println("Enter Users ID Number");
String ID = scan.nextLine();

for (int i = 0; i < IDNum.length; i++) {
if (ID.equalsIgnoreCase(IDNum[i])) {
System.out.println(cpline[i]);
}
}

} catch (Exception e) {
e.getMessage();
}
}
}



Aucun commentaire:

Enregistrer un commentaire