【发布时间】:2013-07-03 10:29:18
【问题描述】:
super关键字(java)等价的c#关键字是什么。
我的java代码:
public class PrintImageLocations extends PDFStreamEngine
{
public PrintImageLocations() throws IOException
{
super( ResourceLoader.loadProperties( "org/apache/pdfbox/resources/PDFTextStripper.properties", true ) );
}
protected void processOperator( PDFOperator operator, List arguments ) throws IOException
{
super.processOperator( operator, arguments );
}
现在我需要什么相当于 C# 中的 super 关键字
最初尝试使用base 是否以正确的方式使用关键字库
class Imagedata : PDFStreamEngine
{
public Imagedata() : base()
{
ResourceLoader.loadProperties("org/apache/pdfbox/resources/PDFTextStripper.properties", true);
}
protected override void processOperator(PDFOperator operations, List arguments)
{
base.processOperator(operations, arguments);
}
}
谁能帮帮我。
【问题讨论】:
-
您必须更具体。你得到什么结果,你期待什么?另外,你为什么在 C# 中使用 Java 类?
-
那说我猜你需要
public Imagedata() : base(ResourceLoader.loadProperties(...))。 -
“现在我需要转换成 C#,实际上我尝试使用 base,但我找不到从 java 获取的预期结果” 你期望什么?
-
实际上使用 java 我可以从 processOperator 方法中提取正确的答案......但我需要通过在 .Net 环境中执行它来获得相同的结果......所以我尝试使用 base kewyword 但我知道我尝试的方式是错误的
-
@Ganeshja 好的,但我们不知道“正确答案”(或“错误”答案)是什么,也不知道如何测试您的代码以查看我们的答案是否正确。