6.6 Array in Java Tutorial With Example using Random Class

preview_player
Показать описание


Follow on Facebook:

Subscribe to our other channel:
Telusko Hindi :

Subscribe to the channel and learn Programming in easy way.

Рекомендации по теме
Комментарии
Автор

at 2.12 there is mistake a[i]=r.nextInt(24); is the range of Random number not the total number element. For total number of element you have already declared in int a[]=new int[50];

deepakkumarvishwakarma
Автор

Im getting this error--->Exception in thread "main"

rushabhmaske
Автор

sir jee, I noticed in random value there is doubling of numbers, like 46 or 44 and so on. is it true to have doubling of numbers in output. or my eye has gone google. lolz, please reply asap.
Ur teaching is very good, i am new to class and have gone through 35 vids in one day, i am listening first and then will start the practical later once understood the method or principles. Thank you

wasimbader
Автор

Sir, is it required to initialize i 2 times. I tried to initialise i at first but it gives me an error.

class enhanced
{
public static void main(String[] args)
{
int a[] = new int[5];
int i;
for(i=0;i<a.length;i++)
{
a[i]=i+1;
}
i=0;
for(i:a)
{
System.out.println(i);
}
}
}

kothamasusairahul
Автор

This Random package is not working in java 9. It's showing error. Plus the line a[i]=r.nextInt(50); is also not working.Its also showing error for the particular line. Please help.

sheikhrasik
Автор

Is someone playing kora kajaz in back😂
Thankyou

deepalithakur
Автор

sir, how to add the random class?..what keys i have to press to get the dropdown containing java.util ?

swarnaraha
Автор

I'm Not Able To Get Drop Down List After Writing Random.. How to get one..??

N.B I'm Newbie in JAVA and I don't know how to do this.

yashsati
Автор

why dont you explain what is nextInt and what is scanner n all. You just use all these stuff but without explaining any of the thing!!

thespiritualjourney