CrazyEngineers
  • import java.util.*;
    class employee
    {
    emp e1=new emp();
    static int limit;
    static Scanner s1=new Scanner(System.in);
    ArrayList  my_list=new ArrayList();
    public static void main(String[] args)
    {
    System.out.println("WELCOME");
    System.out.print("Enter the limit=");
    limit=s1.nextInt();
    employee em=new employee();
    for(int i=0;i//this program does not print different records as entered according to the limit.it displays only the value last entered. example- if i enter 1st record- riti 1 2900
    enter 2nd record-abc 2 1200
    then it displays-
    abc 2 1200
    abc 2 1200
    kindly help me.
    Replies
Howdy guest!
Dear guest, you must be logged-in to participate on CrazyEngineers. We would love to have you as a member of our community. Consider creating an account or login.
Replies
  • Anand Tamariya

    MemberJul 23, 2013

    Add following at the start of input():
    e1 = new emp();
    Are you sure? This action cannot be undone.
    Cancel
  • Rits rishi

    MemberJul 25, 2013

    Anand Tamariya
    Add following at the start of input():
    e1 = new emp();
    i added your statment..but now it's displaying only 1 record & that too last one.
    Are you sure? This action cannot be undone.
    Cancel
  • rahul69

    MemberJul 25, 2013

    Rits rishi
    i added your statment..but now it's displaying only 1 record & that too last one.
    Now, in output function, instead of :
    int j=1
    inside the for loop, write
    int j=0
    😀
    Are you sure? This action cannot be undone.
    Cancel
  • Rits rishi

    MemberJul 25, 2013

    rahul69
    Now, in output function, instead of :

    inside the for loop, write

    😀
    THANK YOU SO MUCH.....👍😁😀
    Are you sure? This action cannot be undone.
    Cancel
  • Rits rishi

    MemberJul 25, 2013

    rahul69
    Now, in output function, instead of :

    inside the for loop, write

    😀
    THANK YOU SO MUCH...😀 👍😀
    Are you sure? This action cannot be undone.
    Cancel
  • rahul69

    MemberJul 25, 2013

    Rits rishi
    THANK YOU SO MUCH...😀 👍😀
    Ur Welcome 😒
    Are you sure? This action cannot be undone.
    Cancel
  • simplycoder

    MemberJul 25, 2013

    #-Link-Snipped-# : I would advise you to get your concepts cleared in this.
    Knowing how arraylist works and why you have to create a new instance every time to add into it would be of a great help.
    Are you sure? This action cannot be undone.
    Cancel
  • Rits rishi

    MemberJul 25, 2013

    simplycoder
    #-Link-Snipped-# : I would advise you to get your concepts cleared in this.
    Knowing how arraylist works and why you have to create a new instance every time to add into it would be of a great help.
    i know..n i am trying my best to achieve perfection..can u give me some programs regarding arraylist that i can practice.??😐 i'll post my answers here..it would be great help from your side..as i am having test on monday & topic is "arraylist".
    please start from easy ones to complex ones..so that i can build up my confidence..😀
    Are you sure? This action cannot be undone.
    Cancel
  • simplycoder

    MemberJul 26, 2013

    Rits rishi
    i know..n i am trying my best to achieve perfection..can u give me some programs regarding arraylist that i can practice.??😐 i'll post my answers here..it would be great help from your side..as i am having test on monday & topic is "arraylist".
    please start from easy ones to complex ones..so that i can build up my confidence..😀
    Ok,
    1)WAP which will take input from user of n integers and print it.
    2)WAP which will print the above list in ascending and descending order.
    3)WAP which will take the input as a string arraylist.
    "I love CE . I am proud to be a CEan ."
    Print the count first.
    Remove '.' character from the above sentence and print the list and the count.
    4)Convert all the characters to lower case and upper case from the above question.
    5)Reverse the sentence along but donot change the order of the alphabets in the word.
    (exected output : . CEan a be to proud am I . CE love I).
    6**)Calculate 100! using arrayList.

    first five are pretty simple. Don't be demoralized if you don't get the 6th one
    Are you sure? This action cannot be undone.
    Cancel
Home Channels Search Login Register