zoukankan      html  css  js  c++  java
  • Java菜鸟学习笔记(4)--常见编译&运行错误汇集(不断更新)

    编译错误区

    error: cannot find symbol

    2.原因:再使用时候可能拼写错误,大小写没有书写正确引起的

    2.示例:

    FloatTest.java:16: error: cannot find symbol
    System.out.println(a/a==Float.NAN);
                                ^
      symbol:   variable NAN \ 正确为NaN,所以显示为找到元素
      location: class Float
    1 error

    运行异常&错误区

    Main method not found in class

    原因:没有写main函数或者main函数书写错误(大小写不对,缺写漏写..)
    示例:
    Main method not found in class FloatTest, please define the main method as:
       public static void main(String[] args)



    Exception in thread "main" java.lang.ArithmeticException: / by zero

    原因:在计算中用(整数)/0,会抛出异常。
  • 相关阅读:
    面试问题记录
    面试问题记录
    面试问题记录
    JavaScript => ?
    Jsr303数据校验
    在浏览器上开发GO和Vue!(基于code-server)
    IdentityServer4 4.0.0
    9/13-9/18
    9/6-9/10
    8/30-9/3
  • 原文地址:https://www.cnblogs.com/incyanggan/p/3176875.html
Copyright © 2011-2022 走看看