考虑JavaFX Script编程语言的几个小问题
我可以传递给整数/数字的最小/最大值是哪些? Integer 在内部使用 java.lang.Integer 吗?如果变量溢出怎么办?它会自动扩展java.lang.Long吗?
在一篇文章中,我读到 def 关键字相当于在 Java 中将变量标记为 Final,但对我来说,它看起来更像是 C 中的 const。JavaFX
有检查异常吗?
遗憾的是,[语言参考][1] 是这样说的:
[待办事项:写章节]
Which are the min/max values I can pass to an Integer/Number? Does Integer use java.lang.Integer internally? And what if the variable overflows? Does it automatically expand java.lang.Long?
In an article I read the def keyword is the equivalent of marking a variable as final in Java but to me, it looks like it's more like const in C.
Does JavaFX have checked exceptions?
Sadly, this is what the [Language Reference][1] says:
[To do: write chapter]
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
JavaFX Script 中 Integer、Float、Long 等的最小/最大值与 Java 相同。您可以使用 Integer.MAX_VALUE。 JavaFX 将在内部编译为 Java 等效项。
Def 旨在用于常量或不可变的单例。
JavaFX Script 没有检查异常,但您仍然可以使用 try/catch 块捕获它们。
The min/max values of Integer, Float, Long, etc. in JavaFX Script are the same as Java. You can use Integer.MAX_VALUE. JavaFX will compile down to the Java equivalents internally.
Def is meant to be used for constants or immutable singletons.
JavaFX Script does not have checked exceptions, but you can still catch them with a try/catch block.