create different instance ?

on the basis of some values(1,2,3,4..) i hav to create different objects ..

if any one can suggest me any way to do it apart from..

IF ELSE

SWITCH

the list is long so i can't create instances and store them in hashtable or any other list..

is there any design pattern for it..

Class.forName("Aclass").getInstance().. return Object type object that can't be referenced by Aclass

thanks

[435 byte] By [PuneetSrivastava_Lko_Indiaa] at [2007-10-2 14:33:20]
# 1
it's called factory pattern or virtual constructor.%
duffymoa at 2007-7-13 12:56:44 > top of Java-index,Other Topics,Patterns & OO Design...