lundi 2 mars 2015

Program runs only at a specific pc



I had to write a program that creates credit card numbers. I wrote 3 classes, the main class, from where i can get the type and the length of the card (eg. Visa 15 digits), the luhn formula and one class where i create the card. From the main class i send the type and the length of the card to the last class. So i started the last class like this:



public class Cards extends Program {

private int[] x = new int[length];
private int[] k = new int[length];
private int length;
private String type;

public Cards(int l, String name) {
length = l;
type = name;
}


which is clearly wrong (error at the compile) but the thing is that only my pc (where i also wrote these classes) can run it, without compile error and getting the correct results. I know where the problem is and the other 2 classes are correct but i want to know how is it possible to run at my pc without a problem.


Ps: I used acm package, my jdk is 1.8.0_31 and i wrote them on notepad++




Aucun commentaire:

Enregistrer un commentaire