gpt4 book ai didi

java Object里面的try {}

转载 作者:行者123 更新时间:2023-11-29 09:56:31 24 4
gpt4 key购买 nike

<分区>

嗨...我有以下代码:

    try { Nrtrde record = new Nrtrde(); }
catch (Exception e) {
System.out.println(" ERROR\n");
e.printStackTrace(); }
finally { Nrtrde record = new Nrtrde(); System.out.println(" OK\n"); }

record.setSpecificationVersionNumber(specificationVersionNo);

编译时出现以下错误:

NRTRDE\ENCODER.java:28: error: cannot find symbol
record.setSpecificationVersionNumber(specificationVersionNo);
^
symbol: variable record
location: class ENCODER
1 error

看来我无法在 try {} 中创建对象并在 try {} 之外使用它..

为什么?

谢谢

24 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com