【发布时间】:2019-09-24 19:50:34
【问题描述】:
错误提示找不到变量。无法找出确切的问题。尝试在 bluej 中也重置首选项。
import java.util.*;
class Electricity
{
public void Initialization()
{
int omr = 0;
int nmr = 0;
int cr = 0;
int rent = 0;
double cost = 0.0;
double sc = 0.0;
}
public void input()
{
System.out.println("Enter old meter reading");
omr = sc.nextInt();
System.out.println("Enter new meter reading");
nmr = sc.nextInt();
}
public void calculate()
{
cr = nmr - omr;
}
public static void main()
{
Scanner sc = new Scanner(System.in);
}
}
【问题讨论】:
-
欢迎来到 Stack Overflow,如果您的问题的答案之一是正确的,您应该接受它。