let there is a class named Calc.java inside this class there is a method named Min
public int Min(int one, int two)
{
return one - two ;
}
Now in the main class that nemed First.java :
package first;
public class First {
public static void main(String[] args) {
Calc y [] = new Calc[3];
System.out.println(y[1].Min(5, 3));
}
}
when Run :
Exception in thread "main" java.lang.NullPointerException at first.First.main(First.java:9) Java Result: 1 BUILD SUCCESSFUL (total time: 0 seconds)
Netbeans shows Hint : Unbalanced read/write with arrays
i don't know what's wrong ! Thanks...
y [1] = new Calc;