Join
Blogs
Questions
Videos
Tags
Members
Search
 
 
Create your own blog, earn points and get popular!

HashMap nad Methods

Hi I have a file customer.txt and it contains details of the customer.

in my programme i have an abstract class caled Customer which is extended by two subclasses OnlineCustomer and IndoorCustomer.

What i need to do is read the content of the file and store it in a HashMap. i need to use a method as the value of the HashMap

something like

HashMap hm = new HashMap();

hm.put(cusID, new Customer(tempid,tempname,tempadd,tempphone));

this runs in a loop and insers data read from the file into the hashmap according to the type of the customer.

if it's a online customer it calls the method in the onlinecustomer class else the indoorcustomer class


how can i do it?

thanx
No votes yet
Share this
0 answers