如何使用 ROME 进行 RSS

发布于 2025-01-02 12:29:47 字数 432 浏览 4 评论 0原文

我正在使用罗马教程页面 http://wiki.java.net/ 中的代码twiki/bin/view/Javawsxml/Rome05TutorialFeedReader

当我尝试编译时,它说class FeedReader is public,应该在名为 FeedReader.java 的文件中声明

我是 Java 新手,但我认为 FeedReader 类应该是示例中使用的包的一部分,或者是导入路径之一。我在下载的罗马库中找不到文件 com.sun.synmination.samples (这是示例中的包)。有什么想法吗?

I am using the code from Rome's tutorials page http://wiki.java.net/twiki/bin/view/Javawsxml/Rome05TutorialFeedReader .

When I try to compile, it says class FeedReader is public, should be declared in a file named FeedReader.java.

I am new to Java, but I think that the FeedReader class should be part of the package used in the example, or in one of the import paths. I can't find file com.sun.syndication.samples (which is the package from the example) in the Rome library I downloaded. Any thoughts?

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

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

发布评论

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

评论(1

恋你朝朝暮暮 2025-01-09 12:29:47

教程中的代码是

package com.sun.syndication.samples;

public class FeedReader {
    ...
}

它必须位于名为 FeedReader.java 的文件中,并放入目录 com/sun/synmination/samples 中。如果更改类的名称,则还必须更改 java 文件的名称。如果更改包声明,则还必须更改文件的位置。

The code from your tutorial is

package com.sun.syndication.samples;

public class FeedReader {
    ...
}

It must be in a file named FeedReader.java and put in a directory com/sun/syndication/samples. If you change the name of the class, you must change also the name of the java file. If you change the package declaration, you must also change the location of the file.

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