Resolving “The method must return a result of type int” in Java

后端 未结 9 659
庸人自扰
庸人自扰 2021-01-21 12:37

I\'m very new to Java. Eclipse is giving me the error

The method must return a result of type int

for the following code:



        
9条回答
  •  说谎
    说谎 (楼主)
    2021-01-21 13:22

    In Java public classes must be in separate files with name the same as class name.

    So put your funk class in funk.java file and firstprog class in firstprog.java file Or delete public in funk class, then this class will have default package modifier.

提交回复
热议问题