对Java方法签名的完全合格的参考 [英] Fully qualified reference to Java method signature

查看:36
本文介绍了对Java方法签名的完全合格的参考的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

在Java中编写对方法名称的完全合格的引用的正确方法是什么?

What is the proper way to write a fully qualified reference to a method name in Java?

  1. Message [] com.sun.mail.imap.IMAPFolder#addMessages(Message [])
  2. Message [] com.sun.mail.imap.IMAPFolder.addMessages(Message [])
  3. 其他方式

推荐答案

如果方法的签名是 Message [] addMessages(Message [] msgs) ...

If the signature of the method is Message[] addMessages(Message[] msgs)...

...并且类名是 IMAPFolder ...

...and the class name is IMAPFolder...

...并且在软件包 com.sun.map.imap ...

...and it's in the package com.sun.map.imap...

...然后,完全限定的方法名称为 com.sun.map.imap.IMAPFolder.addMessages(Message [] msgs).

...then the fully qualified method name would be com.sun.map.imap.IMAPFolder.addMessages(Message[] msgs).

可见的类/实例变量共享相同的模式,尽管出于OO设计的考虑,通常不建议这样做.

Visible class/instance variables share the same pattern, although for the sake of OO design, this is typically discouraged.

通常,人们只关心自己的标准对象名,而不是方法/[instance | class]变量名.

Normally, one only concerns themselves with the fully qualified object name, not the method/[instance|class] variable name.

这篇关于对Java方法签名的完全合格的参考的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆