模棱两可的方法

时间:2012-11-06 07:58:32

标签: java methods paragraph ambiguous

我有这段代码:

public Paragraph paragraph() {
    Paragraph paragraph = new Paragraph(before.getLeading());
    paragraph.add(before);
    if (numbered) {
        paragraph.addSpecial(new Chunk(String.valueOf(pageN), before.getFont()));
    }
    if (after != null) {
        paragraph.addSpecial(after);
    }
    paragraph.setAlignment(alignment);
    return paragraph;
}

编译器说在第二行我有这个错误:

reference to Paragraph is ambiguous, both method Paragraph(float) in Paragraph and method Paragraph(Chunk) in Paragraph match

0 个答案:

没有答案