解决:java报错The method get_discount() is undefined for the type该如何处理?

1.例子如下图所示:

2. 增加代码

private static double get_discount() {
        // TODO Auto-generated method stub
        return 0.7;//return后面就是折扣率,可以随意更改
    }

3.重新运行结果如下:

希望对你有所帮助,谢谢~

猜你喜欢

转载自blog.csdn.net/Along_168163/article/details/121212459