I am way deep into Java which I am pretty much unaware off. But few days of reading has led me to this understanding - I cannot call a non-static method from a a method of a different class.
So, I have a non-static method inside a class (ClassA) with a constructor. Lets call this MethodA.
And in MethodB in ClassB, I am doing this,
MethodB{
public static CommandControl ab;
ClassA objectA = new ClassA(ab)
objectA.MethodA(String S)
}
Now, I have a NullPointerException when the control goes inside ClassA since the value of ab = null.
How do I avoid this?