|
|
|
|
Title: Intermediate Java Tutorial - 19 - Generic Return Types
Added: Feb 28, 2010
Author: thenewboston
Duration: 6:5
Description:
How to return a generic type.
Related Videos:
Videos related to 'Intermediate Java Tutorial - 19 - Generic Return Types'
Channel: Education
Tags: install download jdk se ee java development kit new beginner tutorials eclipse variables if while loop object classes
install download jdk se ee java development kit new beginner tutorials eclipse variables if while loop object classes
Youtube Comments: 39
MrNvbeatz Says:
Dec 23, 2010 - Thanks dude, you are great at explaining. Much better than my JAVA book could ever dream of explaining.
ryderfira Says:
Jan 23, 2011 - How is it that tots is the most?
ra30r Says:
Feb 7, 2011 - well, 1 is before 42, but 42 is bigger than 1. same goes for apples and tots.
fanreymysterio619 Says:
Mar 28, 2011 - I only gives me 1...
tarek11002000 Says:
Apr 21, 2011 - great!
Exfridos Says:
May 7, 2011 - If you have an ';' behind the if statement, it returns the last number you putted in (Don't know why), but if you remove it, it should work like in the tutorial.Again, this is wrong: "if(b.compareTo(a) > 0);", and this is right: "if(b.compareTo(a) > 0)"
zhaoyangster Says:
May 16, 2011 - clear like crystalthanks
sangeegod Says:
Jun 20, 2011 - Hello Bucky,its very clear to understand except one thing ..My doubt is : wat is the need to use " T extends Comparable" in generic return type..I guessed it : since we used compareTo build in function or wat else?Plz clear the doubt..
AvailableThisis Says:
Jun 26, 2011 - Hi Bucky, would you create a video on wildcards with generics? Thanks!
mcward48 Says:
Jul 10, 2011 - does the method have to be static ? .. i mean in general , even if we use it in other class which doesn't have the static main method
MinecraftArt Says:
Jul 16, 2011 - System.out.println("Thank you Bucky!");
bkbenemy Says:
Jul 18, 2011 - Thank you Bukky your best!i got it when i test use Z valuei have a questionwhat will happen if did I use symbols ?which symbol is max ? XD
pplrelax Says:
Jul 19, 2011 - wow you are great at teaching this stuff...much better than my professor lol.
Mladenac Says:
Jul 24, 2011 - It doesn't. He doesn't need objects to present these concepts so he uses static method.You can try using generic methods in instance methods. ;)
scottyhuffmusic Says:
Aug 25, 2011 - i think it's because 't' comes later in the alphabet, i.e. a=1, b=2, c=3,... t=20...
rnagarajanmca Says:
Aug 27, 2011 - Hi this is nagarajan .. i was searching in net 2 days to learn generic methods . your video is really awesome .. i learnt well from your video thank you so much
Glatium Says:
Feb 7, 2012 - I have read the oracle tutorial, char is in unicode 16 format! can u please clear the ambiguity! some say ASCII and UNICODE 16????Help
FedericoJimbo Says:
Mar 4, 2012 - Anything that can crush your mind! LOL..
josemolina0129 Says:
Mar 12, 2012 - error why System.out.println(max(42,1,23));, return 23
anantama Says:
Apr 4, 2012 - T m must be assigned to a, if you would have missed that in the code then the value will be 23. and use import java.lang.Comparable; Cheers
WarriorsOfNet Says:
Apr 17, 2012 - What if i want to khow what type of data is pass to me in a Max function e.g if i pass integer it prints u pass an integer or u pass String in case of strings how i do that...
djleisheng Says:
May 11, 2012 - If you want you can use a conditional statement instead of if statements for the body of the method, like this:T m = a;m = (b.compareTo(a) > 0) ? b : a;m = (c.compareTo(m) > 0) ? c: m;
djleisheng Says:
May 11, 2012 - Or if you want to put in as many objects as you want, change the paramaters to T...a. Then for your body: T last = a[0]; T m = a[0]; for(T i: a) m = (i.compareTo(last) > 0) ? i : m; last = i; return m;Note: make sure you put curly braces around the for loop, I just can't put them in because youtube won't let me. Make sure you close the braces after the line last = i;
seed419 Says:
May 26, 2012 - The java compiler is smart.Tots are better than apples or chicken.












sculptureByKeith Says:
Sep 29, 2010 - It returns tots because it uses the ASC value for the characters a = 141, t = 164, c = 143.