Java ListResourceBundle .handleGetObject (String key)

Syntax

ListResourceBundle.handleGetObject(String key) has the following syntax.

public final Object handleGetObject(String key)

Example

In the following code shows how to use ListResourceBundle.handleGetObject(String key) method.


//from w ww  .  j a  v a2s.co m

import java.util.*;


class MyResources extends ListResourceBundle {


   protected Object[][] getContents() {
      return new Object[][]{
                 {"hello", "from java2s.com"},
                 {"client", "HTML"},
                 {"server", "PHP"}
              };
   }
}

public class Main {

   public static void main(String[] args) {


      MyResources mr = new MyResources();

      // get the object for key hello
      System.out.println(mr.handleGetObject("hello"));
   }
}

The code above generates the following result.