File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
http://aspose.com/file-tools
A friendly place for programming greenhorns!
Big Moose Saloon
Search
|
Java FAQ
|
Recent Topics
Register / Login
Win a copy of
The Mikado Method
this week in the
Agile and other Processes
forum!
JavaRanch
»
Java Forums
»
Java
»
Beginning Java
Author
compering elements
fozia inam
Greenhorn
Joined: Nov 27, 2001
Posts: 4
posted
Nov 28, 2001 18:32:00
0
my problem is that i could not understand that how can i compere the first element of array with thirdone or so on upto the last element.please help me i m confused
William Barnes
Ranch Hand
Joined: Mar 16, 2001
Posts: 965
I like...
posted
Nov 29, 2001 08:25:00
0
Sudo-code, which means I didn't try and compile.
// Make an array. Array ar = new Array[ 10 ] ; // Put something in the array. for( int i = 0; i < ar.length; ar[ i ] = i++) // This compared first array slot to second array slot. if( ar[ 0 ] == ar[ 1 ]) // do something int arOne = ar[ 0 ] ; int arTwo = ar[ 1 ] ; // This compares the value first array slot to second array slot. if( arOne == arTwo) // do something
So here are some examples (ugly though they be). Do these help in anyway or would you like more specific examples?
Please ignore post, I have no idea what I am talking about.
William Barnes
Ranch Hand
Joined: Mar 16, 2001
Posts: 965
I like...
posted
Nov 29, 2001 12:12:00
0
More sudo-code
// Make an array. Array ar = new Array[ 10 ] ; // Put something in the array. for( int i = 0; i < ar.length; ar[ i ] = i++) // Compare first element to every other element for( int i = 1; i < ar.length; i++) { if( ar[ 0 ] == ar[ i ]) { System.out.println("First element matches element # " + i) ; } else { System.out.println("First element doesn't match element # " + i) ; } }
I agree. Here's the link:
http://aspose.com/file-tools
subject: compering elements
Similar Threads
Cant use object from another class
Posting to bump up my count...
WA #1.....word association
The x900 effect ?
Text box value is not being completely filled with request attribute
All times are in JavaRanch time: GMT-6 in summer, GMT-7 in winter