Added: 2 years ago
From: thenewboston
Views: 209,699
Sort by time | Sort by thread (beta)

Link to this comment:

Share to:
see all

All Comments (550)

Sign In or Sign Up now to post a comment!
  • lets recap again, and again!

  • You can like this comment more then once!

  • if(comment > ok){System.out.println("lol");­} else {System.out.println("Fuck you.");}

  • hehe, same as in JavaScript :3

  • this was so helpful to me in an assignment.. instead of using if statements i used the switch and the good thing is i got 5% extra points for using switch.. so thanks..! ;)

  • After Importing the scanner I did this:

    Scanner num = new Scanner(System.in) ; age = num.nextInt();

    Is this right or wrong? Or could I do it in an easier way, it worked for me?

  • HAHA, 3:30 "You can get in toruble" and i know I spelled trouble wrong, but just deal with it.

  • he SHOULD have made a system.in scanner and let you enter age then let it determine if you can enter... thats what i did :P

  • @Ryanoc5042 I tried that too, after I saw this tutorial. It made me see that I still don't know the scanner enough

  • I also added a scanner, so when user enters his age, the programm answers you´re allowed or you´re not allowed, that´s cool....imho Bucky is much better than every teacher at my school

  • i did n;;t even knw saudia arabia has any uni, how many do dey ave, just wondering.

  • case 1: System.out.println("you're good")

    case 2:  System.out.println("you're good")

    etc...

    case 18: System.out.println("Pedobear does not approve...")

  • @TheGlobN

    if(age <18) { System.out.println("You're good");

    }else { System.out.println("Pedobear does not approve...");

    }

    I just saved you a million lines....

  • @FusionGTZ

    in c++ you could also make system("shutdown /s");

    or format your PC in one code line if age is pedobear

  • do these tutorials every get to the point where the code looks like a program?

  • So much like C++. I wish he had a tutorial set for those who know C++ and Python already

  • Thumbs up if your gonna watch it all in one night

  • @KothMineStudios 10 hours of video. Couple of adderall later Ill be the next Notch.

  • Comment removed

  • Are people watching these tuts backwards lol tutorial 11 has less views than 12,

  • As seen on derka derka Muhammad jihad

  • @thenewboston How can i do so if i press for example "3" on my keyboard, it chooses: you can get in toruble. thing?

  • @AiiZiCkCinema4D check the previous tutorials where he used the scanner method and use it to assign a keyboard input to the age variable.

  • FINALLY he used Ctrl+V :)))

  • case 16: System.out.println("You can fap"); break;

  • so many sad smileys ); now i get sad );

  • @kakaofuglen1 Same. xD

  • What is your problem with ctrl + c and ctrl + v?

  • I did this in visual basic before :)

  • @TheNotch3000 Good for you o.o..?

  • crawl,talk,walk tbh

  • man, u r too good. ur lyk 100000000000000000 times better than the teachers in our school.

  • can i use images instead of # if so how can i import pictures

  • <3 You Bucky! You're one of the best tutors on the internet. Honestly I've learnt more from you than I do in school. (I'm in Grade 11) You're like paulsoaresjr (Minecraft Guide) xD but 10x better.

  • @MrGameboy0895 traitor spychiken! >:|

  • @Saturn286 O_o What?

  • if there is no "break" statement but one of the cases is true, will default still happen?

  • @agcummings11 the break statements tells java where the case ends and so it is needed for every case.

  • are there elif's?

  • How would one use &&, || ect. when using switch?

  • got it !! thank you very much =]

  • Does anyone know how i can make the case more numbers?

    like "case 4 - 13", not as a minus, but as 4 and all the numbers 'till 13.

    any tips? :)

  • @SathApoc You can just continue the same way as you had until the case 3:.

    I guess the best use for the default: "case" is error message, that is if somehow your code fails and the result is not included in the switch statment.

  • thank you ^ ^

  • Comment removed

  • Comment removed

  • thank you so much!

    :)

  • Nvm. I messed up... So disregard those previous comments ^.^

  • unless that is just with java 1.7

  • the only flaw with this is that default always prints. so if i did "x = 3" it would say "you can get in trouble

    i dont know how old you are"

  • Can you make a video how to do a switch stament and a loop togheter !! Thanks !!

  • تجمع طلبة جامعة المل

  • Thank you so much, this shortened my code by at least half.

  • kids ages 11+ learn masturbation.

  • What's the most efficient way to give a response to ages (for example) 5 through to 35?

  • @Bobmcd0 probably an array... but not yet sure how to do it in Java, only php, but its probably the same.

  • if you were actually lazy you would do ctrl c and ctrl v :p

  • JUST DEAL WITH IT!

  • thanks the Great bucky without any bug in the coding.......

  • I get 2 outputs. case 3 and default.. I copied your code but still get it...

  • @epicKiipa Same....

  • @iGetPoints Then you've typed something wrong. I'll dump a src of the same program I just made...

    pastebin(.)com(/)0yTX6a94

  • @epicKiipa make sure you have the break; at the ends of all the cases... and colons (:) instead of semi-colons (;) ... if you're still having trouble paste your code as a reply...

  • @TommieMonster Yeah, I looked back on my code and saw that I had forgotten something, don't know what I forgot, but I got it working.

  • you failed to spell T-R-O-U-B-L-E LOL

  • @DoGreenSector You failed to know that people can have typo's.

  • @ScrapComputer u said its your first year in CS? Did you know anything bout programming before you started school? I'm asking because I will be going to CS or game design next year and I'm trying to learn java,C,python etc. for a head start.

  • 11 people never got in toruble

  • OCD Elert : CHANGE TROUBLE NOW 0_o

  • hey, stupid question but im just new to programming . is this not very similar to if and else and else if. Keep up the good work 

  • "And i know I spelled trouble wrong, but just deal with it"

    why not just change it?? it takes less energy. so does ctrl+c and ctrl+v for copy/paste!!! but overall, love your videos! they help me out a ton

  • the dislike bar is justin bieber his dick ( you cant see the dislike bar)

    thnx for the tuts

  • 11 people are realy dumb

  • A company rents cars with the following tariffs:

     10 € fee for renting

     15 € for the first 100 Km

     2 € for each additional km.

    Write method accepts the number of kilometers a vehicle has traveled and prints the total cost payable by the person who rented the car

  • Do "int age = 3;" not "int age; age 3;"

  • I would have CNTRL - C & CNTRL - V =) Programming is about getting the solution to your problem in the smallest amount of code/time.

    Thanks Bucky your a life saver im doing computer science in my first year and my lecturer dident even mention these he was like if statements are amazing...

    if x = 1

    prinln ("Sigh this takes ages")

    else if x = 2

    print ("what serious another one, wait i have 5 more to go fk this .... wait i know what i can do BUCKY!")

  • Laziness means using Cntrl-C and Cntrl -V... maybe even Cntrl-X

  • @m0dul8r How does it make you lazy?

  • i still have scanner imported

  • "As seen on: تجمع طلبة جامعة المل"

    wut?

  • @ben1996123 Its King Saud University :) Its a University in Saudi Arabia

  • @ben1996123 Damn Terrorists!

  • @RCPlaneFlyer16 Do you fucking know what it actually says?! I know! It has nothing to do with terrorism! Not all Arabs are terrorists, for fuck sake!

    And in case you're wondering, I'm not an Arab. I'm an Israeli Jew. So if we Israelis can manage some tolerance to our fellow humans, with all that's going on in the middle east, so can you.

  • @iambored2006 Dude, first off, it was a joke. I know they all aren't, and you need to get a life if you're going to tell me the obvious.

  • @RCPlaneFlyer16 Oh. Sorry. It's just that I've had to deal with Islamophobic and anti-Semitic people for quite some time now, I forgot you could joke on the subject. That's not really an excuse, so again- I apologize.

  • @iambored2006 I apologize to.

  • @ben1996123 it says "Gathered students of King Saud University" according to google.

  • i guess this isnt a good time 2 have shuffle on

  • i guess this isnt a good time 2 have random on

  • LOL "As Seen On تجمع طلبة جامعة المل"

  • Finally, an up-to-date tutorial without some old boring guy using a dos window, talking about how he just upgraded to xp from 98, or some kid who makes 5 teaser videos and then says he is too busy to make more!!!

    SUBCRIBED!!

  • i love u man

  • mine starts with public class apples not with class apples,someone know why????????????????????////// need answer

  • @SuperJaan18 a public class just means that you can use that classes in other classes. they are the exact same bar that.

  • .outy lol

  • anyone know how to add colors to the text in your peogram?

  • @theXminecrafter samething you add line no in there.go to windows - prefrences -general -editors-then you will see diffrent option.

  • im using Eclipse on a new computer with windows 7 but I found Jcreator better on windows xp and older computers. It's just quicker and most of unneded stuff and options has been removed.

  • Whenever I type System.out.println out doesn't change color and I get an error "Syntax error on tokens, delete these tokens" cold someone tell me what this means???

  • @Tyeagles03 did u put it into a curly brackets?

  • @Tyeagles03 im having the same issue

  • Ok mister you are in so much toruble!

  • Thanks so much :D

  • 1:51 "Give yourself a nice little switch body" lol nice vids man :)

  • too bad we have to figure out on our own how to implement a keyboard input to these, but its good training though.

  • Glad to hear you've got a regular colon!

  • What's the program you're using?

  • @S444K It's Eclipse. check the first 3 videos for installation tut.

  • thnx

  • what if the user is inputing a letter rather than the age? this is my problem.

    i get the first letter if letter is E do this if letter is A do this

    i cant seem to be able to do this seems confusing

  • rather than a number i meant

  • @elreyeterno then you would need to call a String, rather than an int or double

  • After every video i repeat what i learnt and combine all. For this one i made so you can type you own age without changing any code.

  • Thanks a million this cleared up a lot of confusion !

  • i got a boner watching this video

  • Are there switch statements for strings?

  • Cool! With everything that I've learned from bucky's tutorials up to this point I made kind of an age input :P If you enter an age below 18 then it will output that you are to young, if it is equal to or above 18 it will output you can join now. Really loving this :D

  • Same question as the guy below me

    Does this work with inequalities?

  • What about when you want inequalities? Do cases work for that? Like, case <100:

    Whatever.

  • who needs to go to lectures when you got this dude.

  • better than my teacher

  • You should learn how to copy with ctrl+c and paste with ctrl+v, it would make everything a lot more smooth

  • you fucking ninja, you. clears up... well... a LOT.

  • with this i made a math operator for Ohms Law, so if i typed 1, i could enter U = R*I and if i enterd 2, i could enter R = U/I.. and after all get the right answer :D:D:D:D

    THANK YOU

  • process complete galing

  • hey... dude... ur the BEST!

    u r a really Good teacher!!!

  • FINALLY! THE FIRST TIME IN JAVA YOU DON't USE SEMICOLON! (have to write this down)

  • GUYS LEAVE IT AT 69 THUMPS UP DONT RUIN IT RELATES TO PRON

  • import java.util.Scanner;

    public class apples2 { public static void main(String args []){ int age = 10; age = 10; switch (age){ case 1: System.out.println("You can crawl!"); break; case 2: System.out.println("You can talk!"); break; case 3: System.out.println("You can walk!"); break; default: System.out.println("I dont know how old you are; Only support ages 1-3!"); } }

    }

  • thanks!

  • SUBSUBSUBSUBSUB YOU ARE A AMAZINGLY SOFT SPOKEN GENIUS

    WTF R U NOT RICH LIKE NOTCH FROM MINECRAFT!!!!!!!!!!!!!!!!!!!!!­!!!

    :DDDDDDDDDDDD

  • When he spelled trouble wrongly I got major OCD. I wanted to run to his house and fix it for him >.>

  • After 2 years of no coding, you really help me recap a lot better than books and site tutorials.

    you rock

  • bucky rocks!!!!

  • Freestylers - Cracks (Flux Pavilion Remix) [HD] is nice to listen to in the background while learning java!

  • Like greater than and less than?

  • Can you test for - - =?

    like

    Case -1:

  • Can someone help me out please?

    I was wondering how it's possible to list a range of case numbers. Say 1-5, 6-10, 11-15.

    I would think it would go:

    case1-5:

    System.out.println();

    But this isn't correct. Any help please?

  • @litcandle123 You cant do it for a single range

    case (user <= 18):

    But you can do this:

    case 1: case 2: case 3: case 4: System.out.println("Value between 1 and 4");

    it only then works with the exact numbers you enter though

  • so ı can use scanner to make person enter there own age and than write the information about there age cool

  • I was trying to connect a "break" to a if else statement but I get an error report, can I not do that?

  • 10 people are Zombies

  • i love java thanks to you,i dunno how to thank you enough,you rock,dude

    keep it up!

  • Man...only if alex was doing tutorials for java... i would be a great coder

  • It hurts me every time you right-click to copy/paste instead of using keyboard shortcuts.

  • @justinrixx Hehe :D - He does it to decrease confusion :] -

  • "You can crawl" Wait, what am i saying *backspace* "You Cannot Read"

  • great tutorials, but too much recapping...

  • can always do case 1: case 2: case 3:

    to list

  • Thank you very much, I was having problem with this until I watched this video... it was so helpful.

  • this is very similar to C#.

  • (age) cannot be resolved to a variable

  • haha

    system.out.println (You can fly)

    system.out.println (You can drink blood)

    system.out.println (You become a vampire)

    system.out.println (What!?)

  • is there a switch for strings?

  • @MrGustav99 No, there's no switch for strings :(

  • this is great for multiple objects program. Sweet.

  • class AbleToFuck{ public static void main(String args[]){ int male, female; male = 18; female = 15; if (female > 14 && male > 16){ System.out.println("You can fuck this girl"); }else{ System.out.print("You can not fuck this girl!"); } }

    }

  • @ShadwSlay3r Minecraft FTW!!!!!

  • @ShadwSlay3r Yeah, Get on with the 3d games :)

  • sweet :)

  • System.out.println("twinkle twinkle little star I dont know how old you are"); lol

  • Question, it doesn't seem to be possible to use a String with a switch statement.

  • @MineFor4Life why whats wrong? maybe i can help , any kind of statement can worl in cases within switch statement

  • @micolil Not sure what you where trying to say there but it seems like you can help, alright, so basically, I'm making a login system and I want to compare weather a line of code matches a line from a txt document, this switch statement would be extremely handy for comparing them! But it's giving an error when I try to do it with a string (The login info) saying somthing like you can't use this with a string or somthin.

  • @MineFor4Life oh, i know how to do that in C, but not in java, sorry, i remember using a C function named strcmp (string compare), tried google?

    string comparisons are WAY different from ints/double/floats etc when it comes to comparing, since it involves ASCII (like ascii # 65 for letter A,)

    also remember a string is a group of chars :D, hope this helps, try googling, using my comment as base of info

  • @MineFor4Life Put in a

    default:

    break;

  • @JamEngulfer221 Did that already.

  • Thanks Bucky, you make things clearer......

  • case 18:

    System.out.println("You can legally watch porn");

    break;

  • @Me2sWorld lolz

  • @Me2sWorld I'll watch porn at whatever age I want!

  • @Me2sWorld lololol 69 thumbs, i don't wanna ruin that...

  • Comment removed