Monday 11 March 2013

isInterface()



isInterface()

Declaration:
public boolean isInterface()
Description:
Determines if the specified Class object represents an interface type.
Returns: true if this object represents an interface; false otherwise.
isArray()
Declaration:
public boolean isArray()
Description:
Determines if this Class object represents an array class.
Returns: true if this object represents an array class; false otherwise.
Since: JDK1.1
getName()
Declaration:
public java.lang.String getName()
Description:
Returns the fully-qualified name of the entity (class, interface, array class, primitive type, or void)
represented by this Class object, as a String.
If this Class object represents a class of arrays, then the internal form of the name consists of the name of
the element type in Java signature format, preceded by one or more “[” characters representing the depth of
array nesting. Thus:
(new Object[3]).getClass().getName()
returns “[Ljava.lang.Object;” and:
(new int[3][4][5][6][7][8][9]).getClass().getName()
returns “[[[[[[[I”. The encoding of element type names is as follows:
B byte
C char
D double
F float
I int
J long
Lclassname; class or interface
S short
Z boolean
The class or interface name classname is given in fully qualified form as shown in the example above.
Returns: the fully qualified name of the class or interface represented by this object.
getResourceAsStream(String)
Declaration:
public java.io.InputStream getResourceAsStream(java.lang.String name)


Description:
Finds a resource with a given name in the application’s JAR file. This method returns null if no resource
with this name is found in the application’s JAR file.
The resource names can be represented in two different formats: absolute or relative.
Absolute format: /packagePathName/resourceName
Relative format: resourceName
In the absolute format, the programmer provides a fully qualified name that includes both the full path and
the name of the resource inside the JAR file. In the path names, the character “/” is used as the separator.
In the relative format, the programmer provides only the name of the actual resource. Relative names are
converted to absolute names by the system by prepending the resource name with the fully qualified
package name of class upon which the getResourceAsStream method was called.
Parameters:
name - name of the desired resource
Returns: a java.io.InputStream object.

No comments:

Post a Comment