1. This site uses cookies. By continuing to use this site, you are agreeing to our use of cookies. Learn More.

Array

Discussion in 'Java' started by IT student, Oct 18, 2009.

  1. IT student

    IT student New Member

    Joined:
    Oct 18, 2009
    Messages:
    1
    Likes Received:
    0
    Trophy Points:
    0
    Hello every one
    I am IT student and I hava aquesion I hop any one help me to solve it
    a quesion is
    • Write a java program to:
      • Read N numbers
      • SWAP two numbers in the array .
      • INSERT a value into the array.
      • DELETE a value from the array.
     
  2. SyferZookie

    SyferZookie New Member

    Joined:
    Nov 6, 2009
    Messages:
    6
    Likes Received:
    0
    Trophy Points:
    0
    Occupation:
    College Student , taking up IT
    Location:
    Philippines
    i can help you but can you please clear the things you wanna ask...
    because its not clear for me
     
  3. checho

    checho New Member

    Joined:
    Dec 18, 2009
    Messages:
    2
    Likes Received:
    0
    Trophy Points:
    0
    1. to read the numbers use -
    Scanner input = new Scanner (System.in);
    int number = input.nextInt()
    2. to swap a number u should make something like
    int a = 0;
    a = arr
    arr = arr[i+1] // instead ot i u can put any number of element u want to switch
    arr[i+1] = a
    3. iam not very sure:
    arr = whatever value u want
    4. i dont know :)
     

Share This Page