#1
  1. No Profile Picture
    Registered User
    Devshed Newbie (0 - 499 posts)

    Join Date
    Dec 2012
    Posts
    1
    Rep Power
    0

    Java programming help


    hi,
    i am new to java.i have been given assignment where i have to display emp name based on state city area.

    i have mysql table employee in db with int id[10],name varchar(20),state varchar(20),city varchar(20),area varchar(20))

    now i need to design my classes in this way
    i should breakdown my table to this class structure
    class state
    {
    state name;
    city[]--> it should display state name and array of cities;
    state[0]->karnataka
    ->bangalore
    ->mysore
    -> shimoga

    state[1]-->delhi
    -->A
    -->B


    }

    my next class

    class city
    {
    city name:area[];
    it should display

    city name-->with array of area[]
    city[0]->bangalore.
    area[0]-->jayangar
    area[1]-->majestic


    }

    class Area
    {

    area name-->array of employees;

    area[0]-->jayanagar.
    emp[o]-->a
    emp[1]-->b

    area[1]-->majestic
    emp[0]-->a
    emp[1]-->n

    }
    basically its like state[] array class
    should display city[]
    and city class should display

    area[]
    and area class shoul display
    emp[]


    i tried to do this using harcoded values and entered values from cmd prompt and searched the class and displayed values and it worked, but the functionality should be like this all class should be linked.

    regards
  2. #2
  3. Daniel Schildsky
    Devshed Intermediate (1500 - 1999 posts)

    Join Date
    Mar 2004
    Location
    KL, Malaysia.
    Posts
    1,554
    Rep Power
    1621

    Show us java codes


    Please post the Java codes you have written so far. Remember to format them using the code highlighter for ease of reading.
    When the programming world turns decent, the real world will turn upside down.

IMN logo majestic logo threadwatch logo seochat tools logo