*
The moose likes Beginning Java and the fly likes making mistake Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of Murach's Java Servlets and JSP this week in the Servlets forum!
JavaRanch » Java Forums » Java » Beginning Java
Bookmark "making mistake" Watch "making mistake" New topic
Author

making mistake

fozia inam
Greenhorn

Joined: Nov 27, 2001
Posts: 4
hi,i have done the mistake sorry for it.
my problem is that i have to this assignment in java.lang
and ihave written acode but the output is not correct.the code is:

plz tell me where i m making mistake
(edited by Cindy to format "for" loop)

[This message has been edited by Cindy Glass (edited November 28, 2001).]
David O'Meara
Rancher

Joined: Mar 06, 2001
Posts: 13459

this thread continues from this one.
David O'Meara
Rancher

Joined: Mar 06, 2001
Posts: 13459

As i understand, you want an array of 20 random integers?
Obviously from your code there are other requirements (such as the range of the numbers and that they are unique)
Can you spell out the requirements for us and we can point out where you are going wrong.
Dave.
Murtuza Thaver
Greenhorn

Joined: Nov 05, 2001
Posts: 3
This might help
<code>
int a[]=new int[20];
for(int i=0;i<20;i++) {
//a[i]=(int)((Math.random()*11)+55);
//I was not sure what range u intended
//for this range is 11 < value < 55
a[i]=11 + (int)(Math.random() *55);

//u need to remove this as this is going to be
//true all the time
//if(a[i]==a[i]){
//continue;
//}


System.out.print(" " + a[i]);
}
}
</code>
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: making mistake
 
Similar Threads
Synchronization doubt
code problem!!!!
Static Initializers
Question on the method is file
Implicitly declared static nested classes