|
|
|
1000 Java Tips ebook
|
|
 

Free "1000 Java Tips" eBook is here! It is huge collection of big and small Java
programming articles and tips. Please take your copy here.
Take your copy of free "Java Technology Screensaver"!. |
|
Easy Learn Java: Programming Articles, Examples and Tips - Page 429
Previous
1060 Stories (530 Pages, 2 Per Page)
Next
Question: What is difference between add() and addElement() in Vector?
|
Answer: This method is identical in
functionality to the add(Object) method (which is part of the List interface).
add(Object ) is due the fact that Vector implements List Interface and it is
appeared since Java 1.2 when Vector was moved to Collections: The collection
classes from earlier releases, Vector and Hashtable, have been
retrofitted to implement the collection interfaces.
addElement is "original" Vector's method....
comments? | | Score: 0
|
Posted by jalex on Monday, January 16, 2006 (18:05:00) (6326 reads)
|
Question: How do I find out how long the JVM has been running?
|
Answer: A Java virtual machine has
a single instance of the implementation class of this interface. This instance
implementing this interface is an MXBean (java.lang.management
package) that can be obtained by calling the
ManagementFactory.getRuntimeMXBean() method or from the platform MBeanServer
method.
The ObjectName for uniquely identifying the MXBean for the runtime system
within an MBeanServer is:
java.lang:type=Runtime
This interface defines several convenient methods for accessing system
properties about the Java virtual machine:
* getBootClassPath()
Returns the boot class path that is used by the bootstrap
class loader to search for class files.
* getClassPath()
Returns the Java class path that is used by the system class
loader to search for class files.
* getInputArguments()
Returns the input arguments passed to the Java virtual
machine which does not include the arguments to the main method.
* getLibraryPath()
Returns the Java library path.
* getManagementSpecVersion()
Returns the version of the specification for the management
interface implemented by the running Java virtual machine.
* getName()
Returns the name representing the running Java virtual
machine.
* getSpecName()
Returns the Java virtual machine specification name.
* getSpecVendor()
Returns the Java virtual machine specification vendor.
* getSpecVersion()
Returns the Java virtual machine specification version.
* getStartTime()
Returns the start time of the Java virtual machine in
milliseconds.
* getSystemProperties()
Returns a map of names and values of all system properties.
* getUptime()
Returns the uptime of the Java virtual machine in
milliseconds.
* getVmName()
Returns the Java virtual machine implementation name.
* getVmVendor()
Returns the Java virtual machine implementation vendor.
* getVmVersion()
Returns the Java virtual machine implementation version.
* isBootClassPathSupported()
Tests if the Java virtual machine supports the boot class
path mechanism used by the bootstrap class loader to search for class files.
This tip is based on Java API(1.5)
comments? | | Score: 0
|
Posted by jalex on Saturday, January 14, 2006 (18:00:00) (2755 reads)
|
|
|