Java generics ❓

  Рет қаралды 97,670

Bro Code

Bro Code

3 жыл бұрын

Java generics tutorial for beginners
#Java #generics# tutorial
Java generic methods 00:50
Java generic classes 07:25
Java bounded types 18:58

Пікірлер: 203
@BroCodez
@BroCodez 3 жыл бұрын
//----------------------- Generic Method ----------------------- public class Main { public static void main(String args[]) { Integer[] intArray = {1, 2, 3, 4, 5}; Double[] doubleArray = {5.5, 4.4, 3.3, 2.2, 1.1}; Character[] charArray = {'H', 'E', 'L', 'L', 'O'}; String[] stringArray = {"B","Y","E"}; System.out.print("Integer Array: "); displayArray(intArray); System.out.println(firstIndex(intArray)); System.out.print("Double Array: "); displayArray(doubleArray); System.out.println(firstIndex(doubleArray)); System.out.print("Character Array: "); displayArray(charArray); System.out.println(firstIndex(charArray)); System.out.print("String Array: "); displayArray(stringArray); System.out.println(firstIndex(charArray)); */ } // Generic method public static void displayArray(Thing[] array) { for(Thing x : array) { System.out.print(x+" "); } System.out.println(); } // Generic method with generic return type public static Thing firstIndex(Thing[] array) { return array[0]; } } //----------------------- Generic Class ----------------------- public class Main { public static void main(String args[]) { //bounded types = you can create the objects of a generic class to have data // of specific derived types ex.Number MyGenericClass myInt = new MyGenericClass(1,9); MyGenericClass myDouble = new MyGenericClass(3.14,1.01); //MyGenericClass myChar = new MyGenericClass('@','$'); //MyGenericClass myString = new MyGenericClass("Hello",'!'); System.out.println(myInt.getValue()); System.out.println(myDouble.getValue()); //System.out.println(myChar.getValue()); //System.out.println(myString.getValue()); } } // ---------------------------------------------------------------- public class MyGenericClass { Thing x; Thing2 y; MyGenericClass(Thing x, Thing2 y){ this.x = x; this.y = y; } public Thing2 getValue() { return y; } }
@TechnoSan09
@TechnoSan09 Жыл бұрын
thank you so much love u bro forever subscriber
@Crispeaks
@Crispeaks 7 ай бұрын
Single-handedly taught me Generics and helped me complete an assignment in 30 minutes. Epic!
@tomaszkarolak6179
@tomaszkarolak6179 3 жыл бұрын
The best tutorials, I've ever seen on YT, thx bro!!!
@angelcastineira2561
@angelcastineira2561 3 жыл бұрын
a lot of new stuff but really well explained, thanks!
@john81487
@john81487 Жыл бұрын
I always go through one of these videos before starting my bootcamp lessons. It makes everything so much easier to get into.
@jojovstojo
@jojovstojo Жыл бұрын
Bro this was the heaviest video of all till now ! Literally my brain just exploded ! But extremely simple and direct - So thank you for such a badass of a teacher
@karanbrar1934
@karanbrar1934 2 жыл бұрын
That 1 dislike is from bro himself, just to keep himself humble... ;)
@patrickjaposmack4573
@patrickjaposmack4573 Жыл бұрын
Excellent tutorial video about generic classes and methods!
@larkinthesky
@larkinthesky 3 ай бұрын
You, my dear Sir, are a legend. Thank you so much for all these incredibly useful instructional videos.
@furki3556
@furki3556 3 жыл бұрын
you have really the best tutorials I have ever seen, thank you. greetings from germany
@kedea159
@kedea159 3 жыл бұрын
Really the best tutorials on KZbin, that I've seen, keep up the good work Bro!
@Naanu_kartik
@Naanu_kartik 3 жыл бұрын
concept cleared 🙌 Thanks Bro...and you have an unique way of explaining the things.
@deeplife9654
@deeplife9654 Жыл бұрын
Let start a campaign to give bro best teacher on youtube award !!!!! ❤❤❤❤❤❤❤ .
@ravenguirao9081
@ravenguirao9081 8 ай бұрын
Thanks, I finally understand Generics, some code training/bootcamps explain it really complicated.. but with you i realized it's just that simple.
@faniliana
@faniliana 3 жыл бұрын
This would be the best java tutorial videos out there. Thank you bro
@lamias7712
@lamias7712 2 жыл бұрын
Thank you so much for your simplified explanation . Straight to the point.
@chris07ism
@chris07ism Жыл бұрын
Thanks again for another relatively simple concept explained in a brilliant way.
@kishorekumar.v6093
@kishorekumar.v6093 6 ай бұрын
Well said Bro, you did exactly what we want. The Duration with perfect explanation, great effort that you spend on it. It pay off man. Good Luck ...
@kedarsambhus3623
@kedarsambhus3623 3 жыл бұрын
Amazing! Easy to understand explanation to generics. Thanks bro.
@victoriagee1059
@victoriagee1059 2 жыл бұрын
Your code is so clean. You really know what you are doing!!!!
@av2678
@av2678 Жыл бұрын
Wow! Generic is so damn useful. I wish i saw this video yesterday lol but still, better than never. Well explained too
@Ethhix
@Ethhix 2 жыл бұрын
Thank you for making this video, it was very helpful and informative! I appreciate it.
@EdgarLopez-dq6zv
@EdgarLopez-dq6zv Жыл бұрын
I really like your videos. You explain complex concepts appears easy, thx man
@comrade107
@comrade107 5 ай бұрын
You are awesome! Thanks for all the help!!
@roxorsrule8604
@roxorsrule8604 2 жыл бұрын
Wow, I'm glad I found your channel. You style is crystal clear and to the point. Although I'm taking other classes you clarify the points I was having trouble with. Thanks man!
@jesseemana9598
@jesseemana9598 Жыл бұрын
this channel is a gold mine
@user-yz9cp6fp4k
@user-yz9cp6fp4k Жыл бұрын
You are the best !!! Thanks for lessons in 2023
@Garrison86
@Garrison86 2 жыл бұрын
Amazing! thanks for this awesome explanation, really appreciate your videos.
@atongpayatoyatu2760
@atongpayatoyatu2760 3 жыл бұрын
what the hell so good java tutorial i ever saw in youtube. thank you very much!
@zxnnightstalker2289
@zxnnightstalker2289 3 жыл бұрын
Very clear explanation. My first clear understanding comes from you. Thanks a lot. ;)
@solutionbybrain9978
@solutionbybrain9978 10 ай бұрын
You are so smart to simplify such big task in a simple ways Thank you bro! Of Eritrea 🇪🇷
@ndthdproduction2900
@ndthdproduction2900 2 жыл бұрын
That's so good for the basic bro ! Hope you do more a bout advanced like more complex generic methods. Hope you doing well bro
@kkspuder
@kkspuder 2 ай бұрын
really thx bro, though i'm watched some videos about generics, i'm still struggling with its use, here's some examples also other videos i watched but i'm not got a good understanding until you open the ArrayList class, everything is clear, i got the key point , this is really a nice video
@swankitydankity297
@swankitydankity297 3 жыл бұрын
Fantastic tutorial! Thank you so much :)
@murrayKorir
@murrayKorir 2 жыл бұрын
well explained especially that part of where you can use 'Thing' instead of 'T' clears the mystery behind why is it always T,E or S.
@mariuspet89
@mariuspet89 Жыл бұрын
Very nice video. You have a nice way of explaining programming concepts.
@nawfalnjm5699
@nawfalnjm5699 3 жыл бұрын
man this video is full of great info , thank you so much !
@calebkrauter4027
@calebkrauter4027 3 ай бұрын
Very helpful! Thank you.
@sergeyb6071
@sergeyb6071 3 жыл бұрын
wow that's a lot of stuff in one tutorial 🤯👍
@jaaeamor7901
@jaaeamor7901 Жыл бұрын
Thanks for making this tutorial. Appreciate it 👍
@traveltheworld5241
@traveltheworld5241 Жыл бұрын
Self learning but I understand easily ,this guy is awesome...
@tunghuynh8504
@tunghuynh8504 2 жыл бұрын
Thanks Bro, this help me to easily understand the basic concept of Generics in Java
@quarduroy1
@quarduroy1 11 ай бұрын
Phenomenal explanation, thank you
@Remolhunter97
@Remolhunter97 3 жыл бұрын
Best tutorials ever, holy shit it's pleasant to learn looking your videos bro, keep going !
@benderbg
@benderbg 8 ай бұрын
Great explanation of an important topic. Thanks Bro!
@ozbayhilmi
@ozbayhilmi 4 ай бұрын
Thank you for this video.
@anandchaudhary8952
@anandchaudhary8952 2 жыл бұрын
Finally after spending 2 days reading the chapter and going over rigerious examples and still being clueless, I've understood generics. Love the channel name 😁
@mariuspet89
@mariuspet89 Жыл бұрын
Yes, his chanel is very good!
@ArielLorusso
@ArielLorusso Жыл бұрын
His channel is not generic
@wolanus
@wolanus 3 жыл бұрын
Thanks for the tutorial, Bro.
@OnlyOneGedeon
@OnlyOneGedeon 2 жыл бұрын
Thank you for this very helpful video
@diamonddunyasi4945
@diamonddunyasi4945 2 жыл бұрын
Thx Bro I think you were descend from the sky 😀. We are waiting for more tutorials... Thank you
@walterwhite2418
@walterwhite2418 Жыл бұрын
Great video thx for your effort !!
@chromeshock3774
@chromeshock3774 Жыл бұрын
Dam, these videos are gold! So helpful in my bootcamp.
@mustapharaimilawal8053
@mustapharaimilawal8053 3 жыл бұрын
Thanks a lot for this amazing tutorial.
@ginasomara267
@ginasomara267 3 жыл бұрын
most helpful generics video on the internet. hands down
@fitzsimmons7
@fitzsimmons7 4 ай бұрын
this was helpful, exploded my brain, thanks
@manyokdavidkuch2054
@manyokdavidkuch2054 3 жыл бұрын
Very good explanation!! Thank u
@hgatl
@hgatl 3 жыл бұрын
Awesome explaining, thx bro!
@almanduku9043
@almanduku9043 3 жыл бұрын
Very useful lesson , thank you sir :)))
@chamindilhara5765
@chamindilhara5765 Жыл бұрын
thanks for teach us
@alexreznitsky6338
@alexreznitsky6338 11 ай бұрын
Thanks a lot!!! great explanation!
@NatyTor
@NatyTor Жыл бұрын
ho mannnnnnn your video are so clearly and amazing!! love you bro! thanks for all!
@rokhafm9412
@rokhafm9412 Жыл бұрын
Thank you bro! Very useful video
@janjeromesoriano1182
@janjeromesoriano1182 3 жыл бұрын
Thank you, it's very helpful.
@andreajeanbatchelor5142
@andreajeanbatchelor5142 2 жыл бұрын
Great examples!
@nasseranaoui3315
@nasseranaoui3315 Жыл бұрын
That was a good tutorial , thanks :D
@SoumilSahu
@SoumilSahu 2 жыл бұрын
Thanks a lot, this was really helpful!
@ethankates5359
@ethankates5359 Жыл бұрын
very helpful, thank you
@marke4246
@marke4246 2 жыл бұрын
I just learned more from a twenty minute video than a two hour lecture from my professor. You have a new bro.
@andersontiban5356
@andersontiban5356 Жыл бұрын
so helpful thankyou
@polatsaryerli3071
@polatsaryerli3071 2 жыл бұрын
thx bro great video so helpful
@waleedharalkathiri1836
@waleedharalkathiri1836 3 жыл бұрын
THE BEST EVER EXPLENATION OF GENERIC CLASS AND METHODS IN KZbin HISTORY🤣
@darianchan4649
@darianchan4649 3 жыл бұрын
very nice tutorial bro keep em coming !
@mihirkohli4804
@mihirkohli4804 3 жыл бұрын
please do data structure love your content
@Snowmanver2
@Snowmanver2 2 жыл бұрын
best channel with best tutorials out there!
@miuwai6211
@miuwai6211 2 жыл бұрын
Very clear explanation. Thank you Bro. :)
@syednizam8616
@syednizam8616 Жыл бұрын
I liked your end of the session music and fast forward music. What are those?
@user-gc9ob4pb3w
@user-gc9ob4pb3w Жыл бұрын
finally I got it. Thank you, Bro!
@hardcoded6325
@hardcoded6325 2 жыл бұрын
very good, the best explanetion in the word!!! (i'm from Brazil)
@quanyufeng579
@quanyufeng579 2 жыл бұрын
Wonderful!!
@dieseldust5315
@dieseldust5315 2 жыл бұрын
Great Tutorial!
@alanwarthon
@alanwarthon 11 ай бұрын
Nice, thanks
@marybenish9716
@marybenish9716 2 жыл бұрын
Love this channel!
@kemann3815
@kemann3815 2 жыл бұрын
Wow. Magnificent
@kyomuhendoprecious8414
@kyomuhendoprecious8414 Жыл бұрын
Thanks alot
@shaynazoedeguzman7418
@shaynazoedeguzman7418 Жыл бұрын
Superb! TYVM Bro code!
@GenjaOrigins
@GenjaOrigins 2 жыл бұрын
I was rejected in interview cause i didnt know what is generics and i saw that in their code xd, i saw many in a generic method. Thx
@Say2Cups
@Say2Cups 3 күн бұрын
This the guy that taught me how to code fr
@chap_01
@chap_01 2 жыл бұрын
Nice channel, nice english, nice elocution, nice explaining.
@davidionesi9207
@davidionesi9207 3 ай бұрын
Thank you, my Bro.
@mackymichel8052
@mackymichel8052 2 жыл бұрын
Great.
@v1krv
@v1krv 2 жыл бұрын
Well explained
@Elan_Altair
@Elan_Altair 2 жыл бұрын
This was really helpful for my exams ,Tq broooooooooo
@dbvs007
@dbvs007 2 жыл бұрын
Awesome 👏
@ferfykins
@ferfykins 2 жыл бұрын
Can you create a generic arraylist to hold multiple types, for example: ArrayList newList = new ArrayList(); ??? Thanks for video, explained very well.
@aruldilip9430
@aruldilip9430 2 жыл бұрын
I learnt lot of things so far from the above 83 videos
@yifansu8432
@yifansu8432 Жыл бұрын
This video is sooooooo awsome.......
@codeevolution1
@codeevolution1 Ай бұрын
best teacher on youtube❤❤
@colinbrowne7053
@colinbrowne7053 3 жыл бұрын
This helped a lot thank you
@harshasuvarna998
@harshasuvarna998 10 ай бұрын
"What the hell is an AtomicLong!!" had me ROTFL
@kaushalprasadyadav9242
@kaushalprasadyadav9242 2 жыл бұрын
Great work bro👍
@alimulmahfuztushar7001
@alimulmahfuztushar7001 3 жыл бұрын
Love your content.
Java serialization 🥣
21:13
Bro Code
Рет қаралды 69 М.
Generics In Java - Full Simple Tutorial
17:34
Coding with John
Рет қаралды 1 МЛН
ПЕЙ МОЛОКО КАК ФОКУСНИК
00:37
Masomka
Рет қаралды 10 МЛН
Когда на улице Маябрь 😈 #марьяна #шортс
00:17
Java lambda λ
18:00
Bro Code
Рет қаралды 86 М.
Java HashMap 🗺️
13:05
Bro Code
Рет қаралды 73 М.
Java multithreading 🧶
15:18
Bro Code
Рет қаралды 118 М.
Java objects (OOP) ☕
10:46
Bro Code
Рет қаралды 148 М.
Java custom exceptions 🛑
10:05
Bro Code
Рет қаралды 69 М.
Java enum 🪐
10:50
Bro Code
Рет қаралды 60 М.
Optionals In Java - Simple Tutorial
15:53
Coding with John
Рет қаралды 194 М.
Java constructors 👷
10:37
Bro Code
Рет қаралды 161 М.
Learn Stack data structures in 10 minutes 📚
10:07
Bro Code
Рет қаралды 179 М.
Java access modifiers: (public, protected, private) 🔒
10:13
A4 Reset to zero
0:26
STYLE YT
Рет қаралды 17 М.
How Neuralink Works 🧠
0:28
Zack D. Films
Рет қаралды 31 МЛН
IPad Pro fix screen
1:01
Tamar DB (mt)
Рет қаралды 7 МЛН
😱НОУТБУК СОСЕДКИ😱
0:30
OMG DEN
Рет қаралды 2,2 МЛН
#miniphone
0:18
Miniphone
Рет қаралды 9 МЛН
Samsung or iPhone
0:19
rishton vines😇
Рет қаралды 8 МЛН