1. Member
Join Date
Aug 2008
Posts
7
Rep Power
0

## problem in args

hi alll
i have proglem in this question

write a program , get one number Example : 25 and print Twenty five.
we must use >>>> intiger.parseint(args(0))

can help me ???? i must solve that to 1 hour:confused:

2. Member
Join Date
Aug 2008
Posts
7
Rep Power
0
i know how write with for , or another . but i diidnt know how write with
intiger.parseint(args(0))

3. parseInt() used to convert string into an int value, using wrapper class.

Java Code:
`int i = Integer.parseInt("12");`
In that way you can handle the string argument.

4. Member
Join Date
Aug 2008
Posts
7
Rep Power
0
hmm . ko i know that but how convert :-?? you can write a simple , to convert this 66524 :-??

5. int i = Integer.parseInt("66524");

6. @OP,

If you're convinced with there suggested solution, don't forget to mark this thread as solved.....

7. Originally Posted by MS_Dark
hmm . ko i know that but how convert :-?? you can write a simple , to convert this 66524 :-??
If you know how to convert what's question you have here.

8. Member
Join Date
Aug 2008
Posts
7
Rep Power
0

## Thank You

Thank You all friend , sorry that question was one of my friend , and i didint know what about that :-??
Thank you again , and i have question (this is for my :D )

i have on array like this >>> int[] arr1 = new int[] {4,1,3,6,87,3};

now i have some repetitious value i sort that and now i want to remove repetitious value,can help me ?

how can remove one value in array

9. In an array you cant to do. So you have to use another collection, like an ArrayList.

You can rebuild an array, basically remove element you don't want to include while copying elements, if you know the index.

Here is a simple way.

Java Code:
```public class CoppyArray {

/**
* @param args the command line arguments
*/
public static void main(String[] args) {
// TODO code application logic here
int[] val = new int[]{1, 2, 3, 4, 5};
int[] newVal = removeElement(3, val);
for(int i = 0; i < newVal.length; i++) {
System.out.println(newVal[i]);
}
}

public static int[] removeElement(int index, int[] arr) {
int[] copy = new int[arr.length - 1];
System.arraycopy(arr, 0, copy, 0, index);
System.arraycopy(arr, index + 1, copy, index, copy.length - index);
return copy;
}
}```
Last edited by Eranga; 08-26-2008 at 10:41 AM. Reason: Adding more

10. i want to remove repetitious value
If you remove a value from an array, does the size of the array change?
To remove a duplicate value, first search the array for the dup, save its index, then make a new array, in a loop copy from the first array to the second array, skipping over the dup entry. Then set the array reference variable to the new array.

11. Quite similar thing I have done in my last post. But I'm not courage to follow that way, if you don't need further the original array. It's just a memory waist. To copy array goes on process with higher memory in reasonable level. It can cause many issues of your original array has large number of elements.

12. Member
Join Date
Aug 2008
Posts
7
Rep Power
0
ok thank you .
yes Norm is right , i think best way copy one to another array and i must didit set array size.
thank you again , i love this site , and best users.

13. If you have solve the thread please mark it as solved. It can be really helpful to all other members.

#### Posting Permissions

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