Calling the inehritor class

Posted on 2006-05-25
Last Modified: 2010-03-31
hi all

I have a main class named AccountsManager(). this calss call another class called Accounts(account_number,account_name) to create multiple accounts. what I need is a way to do certain actions (update) for all the Accounts created when a certain thing happened in one of these accounts. I hope I describe the it clearly.

Question by:ehmf

    Author Comment

    to make the things more clear. In each class Account, I have a function update_fields(). I want to call this function in all the accounts in the same time when a condition happened.
    LVL 92

    Accepted Solution

    you'll need to store your accounts in a list and loop thru them

    private List accounts = new ArrayList();

    public void updateAll() {
       Iterator i = accounts.iterator();
       while (i.hasNext()) {
          Account a = (Account);
    LVL 30

    Assisted Solution

    You might want to call it on separate threads, though, so that it happens parallelly.

    Featured Post

    Enabling OSINT in Activity Based Intelligence

    Activity based intelligence (ABI) requires access to all available sources of data. Recorded Future allows analysts to observe structured data on the open, deep, and dark web.

    Join & Write a Comment

    Java had always been an easily readable and understandable language.  Some relatively recent changes in the language seem to be changing this pretty fast, and anyone that had not seen any Java code for the last 5 years will possibly have issues undeā€¦
    In this post we will learn how to connect and configure Android Device (Smartphone etc.) with Android Studio. After that we will run a simple Hello World Program.
    This tutorial covers a practical example of lazy loading technique and early loading technique in a Singleton Design Pattern.
    This tutorial will introduce the viewer to VisualVM for the Java platform application. This video explains an example program and covers the Overview, Monitor, and Heap Dump tabs.

    729 members asked questions and received personalized solutions in the past 7 days.

    Join the community of 500,000 technology professionals and ask your questions.

    Join & Ask a Question

    Need Help in Real-Time?

    Connect with top rated Experts

    20 Experts available now in Live!

    Get 1:1 Help Now