Kapil Chugh

Greenhorn
+ Follow
since Dec 19, 2000
Cows and Likes
Cows
Total received
0
In last 30 days
0
Total given
0
Likes
Total received
0
Received in last 30 days
0
Total given
0
Given in last 30 days
0
Forums and Threads
Scavenger Hunt
expand Ranch Hand Scavenger Hunt
expand Greenhorn Scavenger Hunt

Recent posts by Kapil Chugh

Hello Arch!
Like all other members, I, too, m very much in high spirits after knowing about yur success story. Many-many congrats! Can u pls send me some tips or notes to me at my e-address: kapilchugh26@usa.net?
Thanks in advance.
18 years ago
Hi everybody!
I want to share my problem with all of you. I have made a java program that should print unique no.s from 0 to 15. But I m finding duplicate no.s even after trying so much. What went wrong? I m enclosing the source code along with it. Thanks to my mentor.
******************* source code******************
import java.util.Random;
class randomLoop
{
public static void main(String k[])
{
int grd[][]=new int[4][4];
int val=1;
Random rand=new Random();
for(int i=0;i<4;++i)
{
for(int j=0;j<4;j++)
{
val=(int) (15*rand.nextDouble());
grd[i][j]=val;
if(grd[x][y]==val)
{
grd[x][y]=(int) (15*rand.nextDouble());
// break;
}
}
try{
System.out.println("Value: "+grd[i][j]);
Thread.sleep(300);
} catch(Exception e) { }
}
}
}
}
18 years ago
In java, a Hashtable stores key/value pairs in a hash table, where you specify an object as a key & a value linked to it is obtained. Key is hashed & the resulting hash code is used as the index at which the value is stored within the table.
Wishing happy programming in Java.
18 years ago
I want to know how an applet can communicate to another? Means, when I select a UI component from applet window, another applet should appear. I have tried getAppletContext() function, but it is not working. What went wrong?
Thanks to the helper, in advance.
18 years ago