How to fix “cannot find symbol error” for my program?

前端 未结 2 1780
温柔的废话
温柔的废话 2021-01-26 10:28

I am struggling to find why I keep receiving this message:

Integer.java:13: error: cannot find symbol
         num = Integer.parseInt(numStr);
                           


        
2条回答
  •  庸人自扰
    2021-01-26 10:37

    @Ricardo Desu Perez

    change your below line

    num = Integer.parseInt(numStr);
    

    to following

    num = java.lang.Integer.parseInt(numStr);
    

    if you intend to call default parseInt method in Integer class else write your own version of parseInt(String) method

提交回复
热议问题