例如:Java內在的File類中有如下方法
@Deprecated
public URL toURL() throws MalformedURLException {
return new URL("file", "", slashify(getAbsolutePath(), isDirectory()));
}
其中“@Deprecated”意在-----這個方法或類不再建議使用。在新版本中有其他方法或類可以代替這個使用,以后的版本也不會再更新這個方法或類
今天試了一下,只要在方法上面加上這個,方法名中間多了划線
public URL toURL() throws MalformedURLException
很爽