Answer the question
In order to leave comments, you need to log in
NullPointerExeption on initialization?
I'm new to programming (I'm learning about the possibilities of OOP), please explain what is the cause of this error. Since when designing, the IDE does not produce any syntax errors. The code is the following:
public static Male[] m;
public static Female[] f;
public static void main(String[] args) {
for(int i = 0; i<10; i++)
m[i] = new Male("Adam",1333,23.00f);
for(int i = 0; i < m.length; i++)
System.out.println(m[i].WhoAreYou());
Answer the question
In order to leave comments, you need to log in
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question