Java typeName and isType functions?
Frank Westlake
frank.westlake at gmail.com
Thu Feb 6 07:59:50 PST 2014
On Thursday 06 February 2014 09:10 PM, Tom McGinn wrote:
> ... can you give me a one sentence description of the Java.isType and
Java.typeName
> functions?
On 02/06/2014 07:52 AM, A. Sundararajan wrote:
> Java.isType(obj) - Returns true if the specified object 'obj' is a Java
> type object. i.e., it was obtained by an earlier Java.type call
>
> jjs> var Vector = Java.type("java.util.Vector");
> jjs> Java.isType(Vector)
> true
> jjs> Java.isType(334)
> false
>
> Java.typeName(obj) - Returns fully qualified name of the type object
> specified (as a string)
>
> jjs> Java.typeName(Vector)
> java.util.Vector
Just add a period at the end there and it will be a sentence.
Frank
More information about the nashorn-dev
mailing list