Java Error: Should be declared in a file named

前端 未结 6 1917
说谎
说谎 2020-12-31 23:21

I\'m fairly new to Java and trying to figure out how to solve the following error:

Error reads

CalculatorWithMemory.java:1: class Calculator is publi         


        
6条回答
  •  灰色年华
    2020-12-31 23:29

    The name of the public class containing main must be same as the file name, in your case the file name should be Calculator.java

提交回复
热议问题