Like any warship or merchant ship, the officers aboard a U-Boat had very specific responsibilities.
The Kommandant of the boat, or the commander, had ultimate responsibility for the entire U-Boat just as the captain of any vessel. In the US Navy and the Royal Navy, the courtesy title of ‘captain’ was used informally to address the skipper of any size of vessel no matter what his rank. In the German Navy, however, this convention did not exist. The only man ever addressed as ‘Captain’ was someone holding the rank of ‘Kapitan.’ So the commander of a U-boat or of any German navy vessel was always refered to in the third person as ‘Kommandant.’
In person, ratings and other officers referred to the commander of a German warship by his rank. Most U-boat commanders held the rank of Kapitänleutnant or Lt. Commander in the US Navy. Because the actual word, ‘Kapitänleutnant’ is hard to say quickly, the rank was, and still is, abbreviated to ‘Kaleu.’ In the German Navy, generally speaking, if you ranked below someone you addressed them with the title of ‘Herr,’ in this case, ‘Herr Kaleu.’ While we translate ‘Herr’ as ‘Mister,’ it is more of an honorific than that the word ‘Mister’ implies.
Confusingly, a Leutnant does not address an Oberleutnant as ‘Herr Oberleutnant.’ There are other confusing parts to this but generally you said ‘Herr’ going up and omitted the word speaking down. Therefore, an officer never addressed a petty officer as ‘Herr Oberbootsman.’ He would just say, ‘Oberbootsman.’
The Kommandant of a U-Boat, by informal courtesy, was the only officer aboard who wore an officer’s white dress cap all the time. No other officers on the boat or petty officers on the boat wore anything but their navy blue caps. This was both an informal recognition but just as important, allowed both the officers and crew to quickly identify the Kommandant in low lighting.