How to print the result of a method with System.out.println

前端 未结 5 2079
萌比男神i
萌比男神i 2021-01-17 02:34

How do I print out the result of a method? I want to print out the return of translate but it displays true or false. Suggestions please.

/**
     * @return         


        
5条回答
  •  小鲜肉
    小鲜肉 (楼主)
    2021-01-17 03:21

    It looks like you mistakenly concatenated your variable pback instead of the result of your translate method in the following statement:

    System.out.println("Paperback: " + pback); 
    

    Instead, replace that statement with

    System.out.println("Paperback: " + translate(pback)); 
    

提交回复
热议问题