You have error in Kindergarten constructor, instead of initializing arr, you are creating local variable, it should look like this:
public Kindergarten(String name, int numOfbaby) {
this.name = name;
arr = new BABY[numOfbaby];
currnt = 0;
}
secondly, you have an ininite loop, move instruction and reading of input into loop.
another issue is that you have invalid format parameters, just use plain concatenation
last, but not least you are missing System.out.println
in display_all
method.
loop should start like this:
Kindergarten k = new Kindergarten("baby", 10);
while (true) {
System.out
.println("what do you want to do? \n a-add a baby. \n b-search for a baby \n c-Delet a baby. \n d-Display all babys.\n e-how many babys need inoculation \n f-exit");
char f = read.next().charAt(0);
//(...)
}