📄 constructors.html
字号:
<html><head><META http-equiv="Content-Type" content="text/html; charset=ISO-8859-1"><title>Calling Constructors</title><link href="../docbook.css" rel="stylesheet" type="text/css"><meta content="DocBook XSL Stylesheets V1.65.0" name="generator"><link rel="home" href="index.html" title="OGNL Language Guide"><link rel="up" href="basicExpressions.html" title="Chapter 4. Expressions"><link rel="previous" href="selection.html" title="Selecting From Collections"><link rel="next" href="staticMethods.html" title="Calling Static Methods"></head><body bgcolor="white" text="black" link="#0000FF" vlink="#840084" alink="#0000FF"><div class="navheader"><table summary="Navigation header" width="100%"><tr><th align="center" colspan="3">Calling Constructors</th></tr><tr><td align="left" width="20%"><a accesskey="p" href="selection.html"><img src="../images/navigation/prev.gif" alt="Prev"></a> </td><th align="center" width="60%">Chapter 4. Expressions</th><td align="right" width="20%"> <a accesskey="n" href="staticMethods.html"><img src="../images/navigation/next.gif" alt="Next"></a></td></tr></table><hr></div><div class="section" lang="en"><div class="titlepage"><div><div><h2 class="title" style="clear: both"><a name="constructors"></a>Calling Constructors</h2></div></div><div></div></div><p>You can create new objects as in Java, with the <tt class="function">new</tt> operator. One difference is that you must specify the fully qualified class name for classes other than those in the java.lang package.<sup>[<a href="#ftn."></a>]</sup><sup>[<a href="#ftn.N1032F" name="N1032F">1</a>]</sup> (for example, <tt class="function">new java.util.ArrayList()</tt>, rather than simply <tt class="function">new ArrayList()</tt>).</p><p><span class="acronym">OGNL</span> chooses the right constructor to call using the same procedure it uses for overloaded method calls.</p><div class="footnotes"><br><hr align="left" width="100"><div class="footnote"><p><sup>[<a href="#N1032F" name="ftn.N1032F">1</a>] </sup>This is only true with the default ClassResolver in place. With a custom class resolver packages can be mapped in such a way that more Java-like references to classes can be made. Refer to the
OGNL Developer's Guide for details on using <tt class="classname">ClassResolver</tt> class.</p></div></div></div><div class="navfooter"><hr><table summary="Navigation footer" width="100%"><tr><td align="left" width="40%"><a accesskey="p" href="selection.html"><img src="../images/navigation/prev.gif" alt="Prev"></a> </td><td align="center" width="20%"><a accesskey="u" href="basicExpressions.html"><img src="../images/navigation/up.gif" alt="Up"></a></td><td align="right" width="40%"> <a accesskey="n" href="staticMethods.html"><img src="../images/navigation/next.gif" alt="Next"></a></td></tr><tr><td valign="top" align="left" width="40%">Selecting From Collections </td><td align="center" width="20%"><a accesskey="h" href="index.html"><img src="../images/navigation/home.gif" alt="Home"></a></td><td valign="top" align="right" width="40%"> Calling Static Methods</td></tr></table></div></body></html>
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -