This example demonstrates how to get the classpath string using the Java program. It is simple that you just need to use the System.getProperty() method with the classpath variable name which will return the classpath string. Lets look at the example. Output This is the simple example to get the classpath configuration in your system …
Core Java
Java Arrays Example
An Array is a data structure which represents a group of elements of same data type. It can store a group of elements either it may be variable or objects. We can define the length of the array, when the array is created. We cannot store some integer values and some string values together in …
Java Serializable Interface
Serialization is a process by which data structures or objects are translated into a format or a sequence of bytes (often called marshaling), which can later be unpacked (often called unmarshalling) in the same/different environment. Since the two environments might be completely different, a common method of serialization and then later deserialization is required. Questions: …
Continue Statement in Java
This example shows how to use the continue statement in Java programming. In my previous example I have explained about the break statement which is useful for termination the look and come out of it. However, in certain cases one might want to terminate only the current iteration and skip to the next iteration. In that …
Break Statement in Java
This example shows how to use the break statement in Java programming. Break itself a keyword that can be used within a block like for, while, do-while or switch statements. The significance of the break statement is to terminate the current loop and exit the block. It is mostly useful in the loops while we …
How To Check Where The Class Loaded From
This example shows to check the path of the class loaded from. This utility would be helpful in certain cases if you want to check the class loading path when there is confusion over multiple libraries exist in the different path. To do that, the below example use the following steps: Get the Class for …
Get Methods Return Type using Reflection
In this example we shall explain with a simple example to get the methods of a class using the reflection and get the return type. You can list the public and private methods of an object using the following steps: Get the Class instance of the class which you want to list the methods. In …
Get Super Class Name using Reflection
With this example, we shall show you how to get the super class of an object and use it using the reflection technique. Lets look at the following example and the steps provided below to understand the program. I have created Employee super class and its sub class Manager Created instance of Manager and assigned …