Step to reproduce: 1. Run the program. In the "Route Planning System" menu, input 1 to choose "GetRoute". Then in the "GetRoute" menu, input 2 to choose "SearchByLeastTrans". 2. For "Please enter start station:", input Kowloon Tong. 3. For "Please enter end station:", input Airport. Actual result: Least Transfer Time:4 Route 1: Kowloon Tong->(Take KTL Line to)Yau Ma Tei or Mong Kok or Prince Edward->(Take TWL Line to)Lai King->(Take TCL Line to)Hong Kong or Kowloon or Tsing Yi->(Take AEL Line to)Airport Kowloon Tong->(Take EAL Line to)Hung Hom->(Take WRL Line to)Nam Cheong->(Take TCL Line to)Hong Kong or Kowloon or Tsing Yi->(Take AEL Line to)Airport Expected result: Least Transfer Time:4 Route 1: Kowloon Tong->(Take KTL Line to)Yau Ma Tei or Mong Kok or Prince Edward->(Take TWL Line to)Lai King->(Take TCL Line to)Hong Kong or Kowloon or Tsing Yi->(Take AEL Line to)Airport Route 2: Kowloon Tong->(Take EAL Line to)Hung Hom->(Take WRL Line to)Nam Cheong->(Take TCL Line to)Hong Kong or Kowloon or Tsing Yi->(Take AEL Line to)Airport I think the problem may be that you left the command printing the route label outside the loop.
Fixed! You are right. I should have foreseen this situation. The println is moved inside the for loop now.