The value of the local variable is not used

后端 未结 2 1992
予麋鹿
予麋鹿 2021-01-29 16:29

all of the variables above have the warning in the title. Could you please tell me why that is happening?

public class DataTypes {
    public static void main(St         


        
2条回答
  •  我在风中等你
    2021-01-29 16:44

    You have defined the variables: x, y, ssn, phone, num and twoLine. But you never use the variables anywhere in the code. For instance, if you print the variables out:

    System.out.println(x + y + ssn + phone + num + twoLine);
    

    All the warnings should disappear

提交回复
热议问题