Тёмный

Java random numbers 🎲 【4 minutes】 

Bro Code
Подписаться 1,9 млн
Просмотров 150 тыс.
50% 1

Java random number generator
#java #random #numbers
random.nextInt()
random.nextDouble()
random.nextBoolean()
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);
}
}

Наука

Опубликовано:

 

12 окт 2020

Поделиться:

Ссылка:

Скачать:

Готовим ссылку...

Добавить в:

Мой плейлист
Посмотреть позже
Комментарии : 243   
@BroCodez
@BroCodez 3 года назад
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); } }
@nagapranithasamudrala2224
@nagapranithasamudrala2224 3 года назад
I am unable to convert it into int . It is showing that random cannot be converted to int
@apurbaganguly9957
@apurbaganguly9957 3 года назад
This code is giving error
@Blackoutfor10days
@Blackoutfor10days Год назад
Can we generate random character
@alikayrafilik6956
@alikayrafilik6956 10 месяцев назад
"Random random, equals new random. That's random." Wise words from our savior.
@serkan7419
@serkan7419 3 года назад
random.nextInt(max - min + 1) + min ; //creates number between two numbers
@3omarhd878
@3omarhd878 Год назад
cant understand can someone say more details ?
@domenicdemski1436
@domenicdemski1436 Год назад
@@3omarhd878 say you want a random integer from 30-100. If we say int max = 100; and int min = 30; when we take the difference of those two, we will be passing 70 into the nextInt method. Note that this will only find a random number from 0-69 now, so we must add 1 inside the parentheses. Our value will now be between 0-70. Adding the min integer afterwards then allows us to generate a number from 30-100.
@muratcangozum2589
@muratcangozum2589 Год назад
Nice
@3omarhd878
@3omarhd878 Год назад
@@domenicdemski1436 thank you
@domenicdemski1436
@domenicdemski1436 Год назад
@@3omarhd878 gotchu
@emmalund7859
@emmalund7859 2 года назад
I'm so glad I found you! Straight to the point and well explained. Thank you so much!
@aya2222
@aya2222 3 года назад
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.
@Daniel_MZA
@Daniel_MZA 3 года назад
I´m not a native English speaker but this guy explains super! I mean I can understand English and this guy does and describes his hobby very understandable.
@techwithdipufrom0ton621
@techwithdipufrom0ton621 7 месяцев назад
Everything after Bro Code teaches becomes easy.
@aaronjackson7942
@aaronjackson7942 Год назад
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!
@juanestebanparraparra6302
@juanestebanparraparra6302 2 года назад
I cant helpt it but returning to your videos whenever I wanna learn programming. Thanks Bro!
@pavelkvasnicka6856
@pavelkvasnicka6856 Год назад
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
@annderby6295
@annderby6295 3 года назад
Now I know how random number generation works for different data types. Thanks.
@Daniel_MZA
@Daniel_MZA 3 года назад
Thanks! :) I would like to see videos about kotlin :) , But this java course I really like it :).
@DesiHabibi
@DesiHabibi 2 года назад
thx for vids !
@chsaireddy22
@chsaireddy22 Год назад
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 "
@achristopoulos
@achristopoulos 3 года назад
The random double numbers have various usages for example statistics , probability etc.
@brendanr8828
@brendanr8828 Год назад
Ty
@MAULIKPATELnamste
@MAULIKPATELnamste 3 года назад
This is GOOD !!! Variety of JAVA courses.
@kelleyannbart8348
@kelleyannbart8348 10 месяцев назад
Very helpful videos, thank you!!
@xplane7879
@xplane7879 3 года назад
Me le coding: Random rand = new Random(); String s = rand.nextString(); RU-vid.out.comment(s); RU-vid: Channel recommendation improved... Me: Wow it worked... 😍🙏
@MAULIKPATELnamste
@MAULIKPATELnamste 3 года назад
This Randomness of the Universe really is helping me
@emdorsfm1625
@emdorsfm1625 2 года назад
I already know alot about programing so the first like 5 vids becuz i know about Strings variables Char boolean etc. but after that it gets realy exiting i realy like java and i would love to master it and with you its so much easy thanks alot
@diegocharrycardenas457
@diegocharrycardenas457 Год назад
Thanks bro great tutorial !
@ayhangumus9877
@ayhangumus9877 Год назад
Thanks for the help before the test.
@CodeTV-oy9sq
@CodeTV-oy9sq Год назад
thx for the knowledge!
@AliiaAbdieva
@AliiaAbdieva Год назад
thank you for great lesson
@code_dynamic8211
@code_dynamic8211 Год назад
Nice tutorial you got there :D
@rufatalizada4006
@rufatalizada4006 2 года назад
Thanks bro!
@venkatasrikarkavuri2089
@venkatasrikarkavuri2089 2 года назад
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
@skyset_
@skyset_ 4 месяца назад
how random of you!
@Barak_Mozes
@Barak_Mozes Год назад
Hey brother, you are a genius, I wish you all the best, thank you
@wallstreetbets7741
@wallstreetbets7741 2 года назад
thx i learnt dfro u again
@meghashah5473
@meghashah5473 Год назад
Superb my Random bro
@filipkuchta_main
@filipkuchta_main Год назад
Finally answers without a need to read 10 pages manual.
@ShahriyarAlam1
@ShahriyarAlam1 Год назад
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++;
@ejay
@ejay Год назад
Why not just cast it in the first one int random =(int)(Math.random()*6);
@trickysachin
@trickysachin 2 года назад
Your videos are informative and interesting
@vidhigill5301
@vidhigill5301 Год назад
nice one bro
@javierpesaresi311
@javierpesaresi311 Год назад
Cool!
@deeplife9654
@deeplife9654 Год назад
love for helping you beat algorithem.
@bartomiejsniadach5795
@bartomiejsniadach5795 2 года назад
another great one
@filiprashev6658
@filiprashev6658 2 года назад
nice!
@aleksandarmilanovic229
@aleksandarmilanovic229 2 года назад
Great job
@ibrahimelazami3247
@ibrahimelazami3247 8 месяцев назад
thx man
@Horatius_23
@Horatius_23 Год назад
Nice:D
@shaysoggy1661
@shaysoggy1661 Год назад
Striaght to the point Thanks bro👍
@matinmonshizadeh
@matinmonshizadeh 2 года назад
Thank you bro
@JuliHoffman
@JuliHoffman 2 года назад
I can make my own random number generator! I know this is kid stuff, but I'm so ridiculously happy right now.
@user-rs2ks1pb1s
@user-rs2ks1pb1s Год назад
Thank you.
@EarlyHusky
@EarlyHusky 5 месяцев назад
"Random random, equals new random. That's random." I agree. Thats random.
@sairos4057
@sairos4057 2 года назад
ty bro
@jayanthbonugu6679
@jayanthbonugu6679 Год назад
Good video
@Minecarthus
@Minecarthus 3 года назад
Thank you soooo much !!!
@BroCodez
@BroCodez 3 года назад
Glad it helped!
@mindreader860
@mindreader860 3 года назад
Excellent Bro ☺♥
@AliHassan-vn6ch
@AliHassan-vn6ch Год назад
Thank you Bro
@atheistbro6798
@atheistbro6798 Год назад
one of the best class
@itlogskina
@itlogskina 3 года назад
Thank you
@javadeveloper19998
@javadeveloper19998 2 года назад
good job
@eugenezuev7349
@eugenezuev7349 2 месяца назад
thanks, bro
@huuloc8719
@huuloc8719 2 года назад
Nice.
@josephstaples8186
@josephstaples8186 Год назад
This is the best video I have ever seen
@Simis999
@Simis999 Год назад
Nobody: Random: Curd would book a star had the Oscars seen Additional Mouse Properties.
@TechnicalStuff-xe3ik
@TechnicalStuff-xe3ik 4 месяца назад
NOICE
@phiphongnguyen3352
@phiphongnguyen3352 2 года назад
thank you very much
@honoredegg
@honoredegg 2 года назад
Random understood. 8th. Thank you, ma Bro Sensei!
@sandilezulu343
@sandilezulu343 2 года назад
hello this video was super helpful, can you please tell me how you changed your background to dark mode? @Bro Code
@user-jw2we6il2x
@user-jw2we6il2x 2 года назад
There is the first video about java, so at the end of it you can find this info.
@alipro1284
@alipro1284 2 года назад
nice
@brawkju3876
@brawkju3876 3 года назад
Nice Bro ;)
@wassimelshamy4957
@wassimelshamy4957 7 месяцев назад
I love this guy!
@garvtech9721
@garvtech9721 2 года назад
thank u soo much u help me lot
@MrLoser-ks2xn
@MrLoser-ks2xn 2 года назад
Thanks
@ardcodelover
@ardcodelover Год назад
Realy nice
@rashmirautela7723
@rashmirautela7723 2 года назад
Thanks bro
@ibrahimylmaz8378
@ibrahimylmaz8378 2 года назад
you are amazing!
@information88info
@information88info 3 года назад
Great
@cweeperyt
@cweeperyt 3 года назад
Very good Video :)
@BroCodez
@BroCodez 3 года назад
thanks for watching Creeper!
@buddhimakaushalya2912
@buddhimakaushalya2912 2 года назад
GG
@gabeishere4990
@gabeishere4990 Год назад
Giga Chad thumbnail in 2020? Very Chad like.
@beom8285
@beom8285 Год назад
The best!!
@honu2980
@honu2980 2 года назад
amazing
@PoorwayTraning
@PoorwayTraning Год назад
thanks
@sanjaykarmakar100
@sanjaykarmakar100 2 года назад
It helped!
@cesara9747
@cesara9747 2 года назад
hi, bro!
@behrangfattahi9328
@behrangfattahi9328 2 года назад
You r great BRO
@louiemunoz
@louiemunoz 2 года назад
sweet
@Madara2B
@Madara2B 3 года назад
decided to make it do 100, got a 69 on my 3rd roll. Worth it
@catman4001
@catman4001 2 года назад
sigma grindset
@anjolianjoli4229
@anjolianjoli4229 Год назад
🔥🔥🔥
@gabriellopes4361
@gabriellopes4361 Год назад
thank god for these channels dude... even tho im a atheist ! this video has 4 minutes but explains a lot !
@stefan5450
@stefan5450 3 года назад
Whup whup :)
@TheErry98
@TheErry98 3 года назад
How can i generate a random value between -6 to 6 for example?
@BroCodez
@BroCodez 3 года назад
int max = 6; int min = -6; int x = random.nextInt((max+1) + max) + min;
@yobrasquared31
@yobrasquared31 2 года назад
I like it Picasso
@biswajeet9826
@biswajeet9826 28 дней назад
Good Work Bruh!! Arigato!!
@BurhanTosuner
@BurhanTosuner Год назад
ellerinize sağlık güzel olmuş. kısa ve öz
@meychilo
@meychilo 7 месяцев назад
thx bro saved me
@user-qn6gi3yz7k
@user-qn6gi3yz7k Год назад
you are best bro
@dasunheshan3627
@dasunheshan3627 Год назад
Wow
@armanali9594
@armanali9594 3 года назад
this code is very useful for me
@omersond4891
@omersond4891 3 года назад
Hello
@omkarpatil9886
@omkarpatil9886 3 года назад
❤️
@Wolfgirl-bi7ie
@Wolfgirl-bi7ie 2 года назад
blue jeans and bloody tears
@tatakaetatakae3358
@tatakaetatakae3358 Год назад
Hi
@Giovanni-Rhonim
@Giovanni-Rhonim 5 месяцев назад
Gos bless you bro +5
@johan-oe9kz
@johan-oe9kz 2 года назад
👍
@HamedAthari
@HamedAthari Год назад
you're the best brooooooo
@o0QuAdSh0t0o
@o0QuAdSh0t0o Год назад
3:40 made me lol
@josuetorres9665
@josuetorres9665 4 месяца назад
yuh
Далее
Java if statements 🚧【6 minutes】
6:12
Просмотров 134 тыс.
Java HashMap 🗺️
13:05
Просмотров 76 тыс.
He turned a baseball into a stylish shoe😱
00:59
Просмотров 867 тыс.
НЕ ПОКУПАЙТЕ ЭТО!
00:29
Просмотров 42 тыс.
Using Math.random in Java
5:32
Просмотров 13 тыс.
Java abstraction 👻
5:30
Просмотров 125 тыс.
Java logical operators ❗ (AND OR NOT)
8:00
Просмотров 66 тыс.
Learn Java in 14 Minutes (seriously)
14:00
Просмотров 4,6 млн
Random Numbers With Math.random() (Java Tutorial)
4:30
How to accept user input in Java ⌨️【8 minutes】
8:02
Variables in Java ✘【12 minutes】
12:32
Просмотров 180 тыс.
Java 2D arrays 🚚
8:06
Просмотров 160 тыс.
Gizli Apple Watch Özelliği😱
0:14
Просмотров 4,6 млн
Mac Studio из Китая 😈
0:34
Просмотров 159 тыс.
Кто производит iPhone?
0:59
Просмотров 428 тыс.