Java random numbers 🎲 【4 minutes】

preview_player
Показать описание
Java random number generator

#java #random #numbers

public class Main {

public static void main(String[] args) {

Random random = new Random();



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

import java.util.Random;

public class Main {

public static void main(String[] args) {

Random random = new Random();

int x = random.nextInt(6)+1;
//double y = random.nextDouble();
//boolean z = random.nextBoolean();

System.out.println(x);

}
}

BroCodez
Автор

"Random random, equals new random. That's random."

Wise words from our savior.

waage_yt
Автор

random.nextInt(max - min + 1) + min ; //creates number between two numbers

serkan
Автор

These videos are super helpful for self taught beginner!
I'm not native English speaker but I could follow your tutorials without any problem thanks to your clear explanation.
Thank you so much! I would like to join your class if you have one.

aya
Автор

Me le coding:
Random rand = new Random();
String s = rand.nextString();
Youtube.out.comment(s);
Youtube: Channel recommendation improved...
Me: Wow it worked... 😍🙏

xplane
Автор

This is the best Java tutorial for beginners, so you can learn Java and English in one hit. Please keep going! I vote for Java advance tutorial. Thanks a lot Bro

pavelkvasnicka
Автор

I'm so glad I found you! Straight to the point and well explained. Thank you so much! <3

emmalund
Автор

The random double numbers have various usages for example statistics, probability etc.

achristopoulos
Автор

Im so happy my friend sent me to your channel, im 32 and ready to have a career change. I have been so addicted to java since starting these video's! thank you brO!

aaronjackson
Автор

I've always just used Math.random() and for a dice I normally just do double randomDouble = Math.random() * 6; and then do integer randomInt = (int)randomDouble; and then randomInt++;

ShahriyarAlam
Автор

I am so excited because new shrek movie was announced by the official twitter page saying Morbin' time is over and its time for shrek to play some shreksophone

venkatasrikarkavuri
Автор

I'm not even good at english ethier at programming but i really like this channel it help me allot to understand java even when he speak English I'm so grateful that i found you broo thank you so much 🙏

salouma-
Автор

I cant helpt it but returning to your videos whenever I wanna learn programming. Thanks Bro!

juanestebanparraparra
Автор

I wish I wanna go past and all my teachers are be like him 🥺
Such a great explanation lot's of Gratitude to you " BRO "

chsaireddy
Автор

Now I know how random number generation works for different data types. Thanks.

annderby
Автор

Thanks! :) I would like to see videos about kotlin :), But this java course I really like it :).

Daniel_MZA
Автор

"Random random, equals new random. That's random."

I agree. Thats random.

Автор

This is GOOD !!! Variety of JAVA courses.

MAULIKPATELnamste
Автор

How can i generate a random value between -6 to 6 for example?

TheErry
Автор

Finally answers without a need to read 10 pages manual.

filipkuchta_main