String callsign;
String airlines[] = {"DLH","BER","TUI","EZY","ACA","AAL","FDX","SKW","ABY","SWR"};
public void assignCallsign()
{
Random r = new Random();
int airline = r.nextInt(10);
int number = r.nextInt(900) + 100;
callsign = airlines[airline] + number;
}
The String Array airlines[] contains 3 letters designating an airline. The random integer airline is used to choose one of those airlines. The random integer number should designate the last 3 characters of an airplanes callsign.
I'm trying to get an output like "BER219", "AAL814" and so on, but upon executing the class, the String callsign is still null :/