我应该导入什么?你好世界计划

发布于 2025-01-05 10:29:18 字数 518 浏览 4 评论 0原文

我对 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 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(2

泪意 2025-01-12 10:29:18

对于该特定代码,我认为您不需要导入任何内容。您使用的唯一软件包是您已经可用的System

如果你想做更复杂的事情,你可能至少需要:

import net.java.games.jogl.*

尽管你无疑可以通过导入特定的东西来施加比这更细粒度的控制。

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:

import net.java.games.jogl.*

although you could no doubt exert a finer-grained control than that, by importing specific stuff.

一生独一 2025-01-12 10:29:18

如果您除了打印该字符串之外不打算执行任何操作,则无需进行其他导入。仅当您在程序中使用它(例如 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.

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文