MyResources.java Source code

Java tutorial

Introduction

Here is the source code for MyResources.java

Source

import java.util.HashSet;
import java.util.ListResourceBundle;
import java.util.Set;

class MyResources extends ListResourceBundle {
    public MyResources() {
        super();
    }

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

    protected Set<String> handleKeySet() {
        return new HashSet<String>();

    }
}

public class Main {
    public static void main(String[] args) {
        MyResources mr = new MyResources();

        System.out.println(mr.getString("hello"));
    }
}