m0_62630742 2021-10-12 20:22 采纳率: 100%
浏览 67
已结题

刚学Java 在模仿别人的代码 但是错误:找不到符号

System. out. println(" cubic centimetres.");
符号:方法 println(String)
位置:类型为PrintlnStream的变量 out

public class BoxVolume {

    public static void main(String[] args) {
    
            int width = 20;           // width of cube in cms
            double length = 30.5;     // length of cube in cms
            double depth = 10.5;      // depth of cube in cms
            
            // compute the volume
            double volume = width*length*depth;
            
            // write the result 
            System. out. print("Your box has a volume of ");
            System. out. print(volume);
            System. out. ptintln(" cubic centimetres.");
     }

}

D:\myJava> javac BoxVolume.java
BoxVolume.java:15: 错误: 找不到符号
System. out. ptintln(" cubic centimetres.");
^
符号: 方法 ptintln(String)
位置: 类型为PrintStream的变量 out
1 个错误

  • 写回答

6条回答 默认 最新

  • stacksoverflow 2021-10-12 20:53
    关注

    System. out. ptintln(" cubic centimetres.");
    改成
    System. out. println(" cubic centimetres.");

    本回答被题主选为最佳回答 , 对您是否有帮助呢?
    评论
查看更多回答(5条)

报告相同问题?

问题事件

  • 已结题 (查看结题原因) 10月12日
  • 已采纳回答 10月12日
  • 修改了问题 10月12日
  • 修改了问题 10月12日
  • 展开全部

悬赏问题

  • ¥15 metadata提取的PDF元数据,如何转换为一个Excel
  • ¥15 关于arduino编程toCharArray()函数的使用
  • ¥100 vc++混合CEF采用CLR方式编译报错
  • ¥15 coze 的插件输入飞书多维表格 app_token 后一直显示错误,如何解决?
  • ¥15 vite+vue3+plyr播放本地public文件夹下视频无法加载
  • ¥15 c#逐行读取txt文本,但是每一行里面数据之间空格数量不同
  • ¥50 如何openEuler 22.03上安装配置drbd
  • ¥20 ING91680C BLE5.3 芯片怎么实现串口收发数据
  • ¥15 无线连接树莓派,无法执行update,如何解决?(相关搜索:软件下载)
  • ¥15 Windows11, backspace, enter, space键失灵