0

I wrote a client to get EJB's deployed in JBoss. I referred to examples in internet. Almost all of them use Properties class to define the URL and initial context factory. I want to know why properties is preferred over hashtable as here we are not storing it to file or reading from it? One sample in internet is -

Properties props = new Properties();
props.put(Context.INITIAL_CONTEXT_FACTORY,
"com.sun.jndi.fscontext.RefFSContextFactory");
props.put(Context.PROVIDER_URL, "file:///");

// Create the initial context from the properties we just created
Context initialContext = new InitialContext(props)
ajith
  • 5
  • 2

1 Answers1

0

It isn't 'preferred'. It's much the same thing. Properties extends Hashtable. See the Javadoc.

user207421
  • 305,947
  • 44
  • 307
  • 483