Home » Core Java » lang » Page 5

lang

Determine Operating System with System

This is an example of how to determine the Operating System with System class. The System class, that contains several useful class fields and methods. This class cannot be instantiated. Determining the Operating System with System class implies that you should: Use the getProperty(String key), for the os.name, os.version and os.arch keys. This method gets the system property indicated by ...

Read More »

Suggest Object Finalization to the JVM

In this example we shall show you how to suggest an Object Finalization to the JVM. We are using the Runtime class. Every Java application has a single instance of class Runtime that allows the application to interface with the environment in which the application is running. The current runtime can be obtained from the getRuntime method. An application cannot ...

Read More »

Suggest Garbage Collection to the JVM

With this example we are going to demonstrate how to suggest Garbage Collection to the JVM. We are using the Runtime class. Every Java application has a single instance of class Runtime that allows the application to interface with the environment in which the application is running. The current runtime can be obtained from the getRuntime method. An application cannot ...

Read More »

Get JVM memory information with Runtime

This is an example of how to get the JVM memory information with Runtime class. Every Java application has a single instance of class Runtime that allows the application to interface with the environment in which the application is running. The current runtime can be obtained from the getRuntime method. An application cannot create its own instance of this class. ...

Read More »

Get number of processors with Runtime

In this example we shall show you how to get the number of processors with Runtime class. Every Java application has a single instance of class Runtime that allows the application to interface with the environment in which the application is running. The current runtime can be obtained from the getRuntime method. An application cannot create its own instance of ...

Read More »

StringBuffer delete characters

With this example we are going to demonstrate how to delete characters using a StringBuffer. A StringBuffer is a thread-safe, mutable sequence of characters. A string buffer is like a String, but can be modified. At any point in time it contains some particular sequence of characters, but the length and content of the sequence can be changed through certain ...

Read More »

StringBuffer reverse method

This is an example of how to use the reverse method of StringBuffer. A StringBuffer is a thread-safe, mutable sequence of characters. A string buffer is like a String, but can be modified. At any point in time it contains some particular sequence of characters, but the length and content of the sequence can be changed through certain method calls. ...

Read More »

StringBuffer insert method

In this example we shall show you how to use insert method of StringBuffer. A StringBuffer is a thread-safe, mutable sequence of characters. A string buffer is like a String, but can be modified. At any point in time it contains some particular sequence of characters, but the length and content of the sequence can be changed through certain method ...

Read More »

StringBuffer replace method

With this example we are going to demonstrate how to use replace method of StringBuffer. A StringBuffer is a thread-safe, mutable sequence of characters. A string buffer is like a String, but can be modified. At any point in time it contains some particular sequence of characters, but the length and content of the sequence can be changed through certain ...

Read More »

StringBuffer append method

This is an example of how to use append method of StringBuffer. A StringBuffer is a thread-safe, mutable sequence of characters. A string buffer is like a String, but can be modified. At any point in time it contains some particular sequence of characters, but the length and content of the sequence can be changed through certain method calls. Appending ...

Read More »