我应该导入什么?你好世界计划
我对 Jogl 和 Java 完全陌生,我应该在这个 Hello world 程序中导入什么?谢谢!
public class HelloWorld
{ // open HelloWorld
public static void main (String args[])
{ // open main
try
{ // open try
System.loadLibrary("jogl");
System.out.println("Hello World! (The native libraries are installed.)");
} // close try
catch (Exception e) // all try's need a catch
{ } // even if the catch does nothing
} // close main
} // close HelloWorld
Im completely new to Jogl and Java and what am i supposed to Import in this Hello world program? Thanks!
public class HelloWorld
{ // open HelloWorld
public static void main (String args[])
{ // open main
try
{ // open try
System.loadLibrary("jogl");
System.out.println("Hello World! (The native libraries are installed.)");
} // close try
catch (Exception e) // all try's need a catch
{ } // even if the catch does nothing
} // close main
} // close HelloWorld
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(2)
对于该特定代码,我认为您不需要导入任何内容。您使用的唯一软件包是您已经可用的
System
。如果你想做更复杂的事情,你可能至少需要:
尽管你无疑可以通过导入特定的东西来施加比这更细粒度的控制。
For that particular code, I don't think you need to import anything. The only package you use is
System
which is already available to you.If you want to do more complicated stuff, you'll probably need, at a minimum:
although you could no doubt exert a finer-grained control than that, by importing specific stuff.
如果您除了打印该字符串之外不打算执行任何操作,则无需进行其他导入。仅当您在程序中使用它(例如 BufferedReader 等)时才需要导入。
If you are not going to do anything other than print that string then no need for other imports. Importing is only necessary if your using it in your program like BufferedReader, etc.