Results 1 to 3 of 3
  1. #1
    yuvi461 is offline Member
    Join Date
    Jan 2008
    Posts
    3
    Rep Power
    0

    Post Collections framework

    import java.io.*;
    import java.util.*;

    class Arry
    {
    public static void main (String args[])throws Exception

    {

    int id[]=new int[5];
    String name[]=new String[5];
    String dept[]=new String[5];

    BufferedReader br =new BufferedReader(new InputStreamReader(System.in));


    for(int i=0;i<5;i++)

    {

    System.out.println("Enter Id");

    id[i] = Integer.parseInt(br.readLine());

    System.out.println("Enter New name");

    name[i]=br.readLine();

    System.out.println("Enter Department");

    dept[i]=br.readLine();

    }

    //Arrays.sort(name);

    for(int i=0;i<5;i++)

    {
    System.out.println(id[i]);
    System.out.println(name[i]);
    System.out.println(dept[i]);
    }

    }

    }

    how can i display this as a list.(ie) correspondingly printing the fields.
    Last edited by yuvi461; 01-09-2008 at 11:43 AM.

  2. #2
    roots's Avatar
    roots is offline Moderator
    Join Date
    Jan 2008
    Location
    Dallas
    Posts
    293
    Rep Power
    7

    Default

    Quote Originally Posted by yuvi461 View Post
    Using the collections framework I want you to create and display a List,

    that is sort them by department.
    Isn't that rude ..
    dont worry newbie, we got you covered.

  3. #3
    CaptainMorgan's Avatar
    CaptainMorgan is offline Moderator
    Join Date
    Dec 2007
    Location
    NewEngland, US
    Posts
    835
    Rep Power
    9

    Default

    Quote Originally Posted by yuvi461 View Post
    Using the collections framework I want you to create and display a List,

    then sort them by department.
    How dare you.
    Vote for the new slogan to our beloved Java Forums! (closes on September 4, 2008)
    Want to voice your opinion on your IDE/Editor of choice? Vote now!
    Got a little Capt'n in you? (drink responsibly)

Similar Threads

  1. Replies: 0
    Last Post: 04-16-2008, 11:39 PM
  2. Performance Of Collections
    By thomasprabu in forum Advanced Java
    Replies: 0
    Last Post: 01-05-2008, 12:17 PM
  3. NIO Framework 0.9.3
    By JavaBean in forum Java Software
    Replies: 0
    Last Post: 10-31-2007, 06:29 PM
  4. Aranea framework 1.0.10
    By levent in forum Java Software
    Replies: 0
    Last Post: 07-31-2007, 07:48 PM
  5. Clover framework 2.2.0
    By levent in forum Java Software
    Replies: 0
    Last Post: 07-26-2007, 09:21 PM

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •