Your convert method is static. That means that it is a class-wide method. Your ArrayList "c" is a property of the NumberBase class. Since convert is static, it does not have access to Object-specific properties declared in the class (static means it's a method of the class, not a method that acts on an object).
Basically - if you want to access the properties you defined, you have to make a member of the class they are defined for. Static methods don't need an actual Object to function.
If you remove the static keyword from convert:
public String convert(String input, int base_in, int base_out){
int i = 0;
while(i < input.length()){
c.add(Character.valueOf(input.charAt(i))); //(*****)
i++;
}
You can call it with:
public static void main(String args[]){
NumberBase b = new NumberBase();
String s = b.convert("test", 0, 3);
}
Because your method was static, you never actually instantiated a member of the NumberBase class. This means that your constructor was never called:
public NumberBase(){
i = 0;
c = new ArrayList <Character>();
}
Since you were instantiating (creating) your ArrayList Object in your constructor (which was never called), when the convert method tried to access the ArrayList "c" there was nothing there and you got an exception.
EDIT:
If your method must be static, to use an ArrayList inside of it you either need to pass one in as a parameter or instantiate an ArrayList inside of your method.
ArrayList<Character> c = new ArrayList<>();
^ If you put that inside of the body of your method (somewhere before you use it!) you will not get null pointer exceptions.