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

Link to this comment:

Share to:

All Comments (170)

Sign In or Sign Up now to post a comment!
  • I'm a C# programmer, and I can tell you now that Java is almost the same in terms of syntax. So if you can understand this, it won't take long to understand C# too. He explains it very well too. I'm just skimming through and checking if there is anything I wouldn't know.

  • I used to use nested if statements like you ... but then I took an arrow to the knee :(

  • @dirtylowlife You've managed to sink that low, you have nothing better to do but post an old, dead, never funny joke?

  • Am I the only one who knew there was going to be an 'ifception' top comment?

  • You should use some shortcuts like CTRL + C/V and syso followed by CTRL + Space (System.out.println();).. By now, people should know.

  • haha the comments are funny as always :D

  • Gotta make my mind up... Which seat... Can... I take...

  • if(age > 100){ System.out.println("You are probably dead.");

    }

  • @MrYouMath or maybe in Guiness Records :P

  • @robisdabest1eva solved this challenge but i cant past source :( but i used 3 if statements for saying that if the water is less then 0 then its ice if the water is more then 100 then its vapor and if the water is more then 0 AND less then 100 then its water

  • Thx for ur tutorials the helped me to pass my first programming exam =P

    btw u don t have to write every time System.out.pritln. u could just write Syso then type Control Key+ Space bar and it comes out itself :)

  • @Gre89ful Good tip

  • okay guys, first challenge.

    Make a little calculator where people can input the current temperature in Celsius of their room and your output will tell them what state water would be in that room. Good luck!

  • @robisdabest1eva Nice with a little challenge to practice this. Nailed it B)

  • Comment removed

  • Was Kelsy And Nicole TUNA!!!!!

  • IFCEPTION!!!

  • So what is a string that you have been using

  • So I'm rewatching the series for second time (all is clear now) and thought: "I'm going to read the top comments"..... ..... OHH right one is mine :D

  • Can anyone plaese tell me what this means

    not a statment.

    Cause Im doing a programm that converts money into pounds and I have this error

    Thank you !!!

  • No sound?

  • @Jarod1453 why copy a top comment? lol

  • @wipperol topcommentception.

  • If statement inside an if statement inside an if statement? IFception!!!!!

  • nestedcepton

  • koenigsegg1000 man thanks alot before I read your comment i tried to make if ( name.trim() == "shpend") {....} but your example helped me alot thanks alot

  • thenewboston bucky All your video are subscribed and liked

  • hello can somebody help me!

    I writed for example:

    System.out.println("Write your name: ");

    String name = input.nextLine();

    if(name == "shpend"){ System.out.println("Hello " + name);

    else{ System.out.println("This is else"); }

    when i writed shpend the if statement it shows This is else, I don't understand why should it be Hello Shpend because for name i gave shpend so the shpend == "shpend" but it shows only this is else can some1 tell me why it shows else and not Hello shpend

  • @shpenddbajgora the error is in your if statement.... it should be....if(name.equals("shpend")­) .

  • @shpenddbajgora Java is case sensitive. Or it could be @koenigsegg1000 ;)

  • Eveyone here! Each time you copy and paste this way, god kills a cat! True story!

  • @o0Richard good! my apartment has plenty of those filthy beasts.

  • Soooooo helpful!! Thank you thank you thank you!!

  • Bucky you are great!

  • this is good.

  • 1:25 no, i'm pretty sure i'm not old

  • 1:29 "cuz i told you later"

    ...oh bucky

  • Wouldn't it be easier to make these into "else if" statements???

  • @C0GSniper nope. if the first condition is met it stops checking the rest.

  • @Theguywithrandomname it is bad coding practice to check equality between strings using "==" he is right in using the equals method. The problem is he put semicolons after the if statements before they reached the code inside of them.

  • wasnt this obvious....

  • import java.util.Scanner;

    public class Shagrat { public static void main(String Shagrat[]) { System.out.print("Hellow, please tell me if you like marijuana."); Scanner scan = new Scanner(System.in); String question = scan.nextLine(); if(question.equals("yes")); System.out.print("wow");

    if(question.equals("no"));

    System.out.print("jerk"); }

    why does my code print wowjerk nomadder if i say yes or no

  • @2112mbell try if(question == "yes) and if(question =="no") instead

  • @2112mbell The problem is that you put semicolons after your if(question.equals("yes")); Java saw this and went ahead and checked to see if it equaled yes. Regardless of the equality however, it saw the semicolon and assumed that you put no code within the body of the if statement. It then went and executed the print statement, and did the same with the other if statement. Remember if statements themselves don't get semicolons. You should use curly braces to organize your statements.

  • Im having problems getting a string input into multiple if statements. Anyone please help me with why the code below doesnt work. Pls!

  • import java.util.Scanner;

    public class Shagrat { public static void main(String Shagrat[]) { System.out.print("Hellow, please tell me if you like marijuana."); Scanner scan = new Scanner(System.in);

     String question = scan.nextLine(); if(question.equals("yes")); System.out.print("wow");

    if(question.equals("no"));

    System.out.print("jerk"); }}

  • why not only write System.out.println("Nicole");?

  • If statements within if statements.

    Isn't that ifception?

  • @Aflacduck247 Naw, Javaception is catchier.

  • haha the views start to drop around here

  • dude ur vids are amazingly helpfull u should win a medal for being amazinnngggggggggggg

  • it's impossible to make a string be equal to an int? Wtf... so my program is impossible!

  • @EpicnessPivotMaster thats because they are both variables

    ints are JUST WHOLE NUMBERS, nothing else, strings are JUST BLOCKS OF TEXT, NOTHING ELSE

    you CAN however use that %s to input the int within the quotes of your String

  • An if statement within an if statement

    BWOOONG

  • import java.util.Scanner;

    public class MainClass { public static void main(String args[]){ int age = 60; if(age < 40) System.out.println("You still have some luster!"); else System.out.println("You have lost all of your luster!"); }

    }

  • Great tutorials...Need to cram this info into brain now. *Opens up head*

  • An if statment within another if statement?

    Ifception.

  • @shadowscorp12 haha

  • @shadowscorp12 LOL genius

  • @shadowscorp12 ROFL

  • @shadowscorp12 WE NEED TO GO DEEPER!

  • @shadowscorp12 you ment an if statement within an if statement within the matrix

  • When you copy stuff over it just makes me type faster. You never learn 'till you have hands-on practice with this stuff.

    Writing it helps more than typing really but you won't ever be writing out Java on paper.

    Still, typing is better than coping because you remember it.

    If I copied "System.out.println()" every time I would never remember it.

  • @Msz9Music you can write syso and then press ctrl + space. Easy to remember, and faster.

  • @Darthshepius Agree

  • omg you make java easy as eating chips , dude you are the best java teacher :)

  • Ifception.

  • Im going to start out with console apps then I will go further win apps I think that its a good way to get what I want and thanx for ur tuts btw ur the best subscribed :3

  • Comment removed

  • wait wouldn else if not be better here

  • computer: Ohhh come ON NOW I HAVE TO MAKE ANOTHER DECISION. THIS GUYS A RAM EATER :@

  • @Cukan18 wth? you got like 1mb of ram lol?

  • @Phillie103 Either 4 gigs or 8 gigs XD

  • all the brilliant words seem to be an understatement of your brilliance.

  • if your 49, your old....

  • this is a vulgar display of skill,,,,,tnx bucky!!

  • You are to good !!

  • tnx Bucky,, for making ur java tutorial as simple and clear as possible

  • bucky you explain really good..My teacher could explain that good so i go through every tutorial of yours....Thanks a lot!!1

  • I wonder how old YOU are though.

  • Comment removed

  • i like java more than python

  • import java.util.Scanner;

    class apples{ public static void main (String args[]){ Scanner input = new Scanner(System.in); System.out.println("enter new num:"); int temp = input.nextLine(); if (temp < 50){ } }

    }

    guys y this is wrong cant get it hmf

  • @vinziko You do realise that you need input.nextInt() for int temp NOT input.nextLine() which is for Strings..

  • @vinziko

    Yea man you need to replace the "input.nextLine" to "input.nextInt" becuase you created a num not a string

  • @OomorganoO don't forget the brackets! input.nextInt();

  • questionnnnn, why he doesnt use ctrl+c and ctrl+v as everyone else¿

  • @xXxDiukexXx Because everyone hates tutorials that use tutorial shortcuts. It makes it confusing, since you can't see the keyboard.

  • @sheepnote but its copy pasta... everyone know how to do it...

  • @xXxDiukexXx Some n00bs don't.

  • @sheepnote lol if they don't know how to do ctrl+c and ctrl+v they shouldn't learn any programming languale... xD

  • @sheepnote lol if they don't know how to do ctrl+c and ctrl+v they shouldn't learn any programming language... xD

  • @xXxDiukexXx It's command+c on my computer...

  • @sheepnote i think u tried this!!!!!!

  • @xXxDiukexXx I cringe everytime I see someone using a laptop use the touchpad to right click and then copy and paste...

    Seriously? So much easier to Ctrl+C and Ctrl+V...

  • So let's copy that, because we're lazy!

    hahaha :p

    Nice tutorials man :)

  • the correct term is you are wise, not old

  • awesome ...... i didnt really thought dat java ll become simpler n funny after ur teaching!!!..... thnx bro!!! keep ur work going>>>>>>

    Bucky r u teaching on any other languages???

  • awesome.... i didnt really though dat java ll become this much simpler n funny after ur teaching.... thanx bro!!!! keep ur work going...>>>

  • int age = 80;

    console:

    You are old

    You are REALLY old!

  • dang? ! You are legend?! can i borrow one of your eggs to place in my test? yah no just for a private tutor! LMFAO!

  • the #'s of these overwhelm me

  • HOMEWORK ASSIGNMENT: Write two nested if statements, one under if (){ , the other under }else{ . Include User Input for the variable (shown in tutorial # 6).

  • I actually figured this out by myself about 20 minutes ago.

  • I love your tutorials! I've seen 1 to 18 now in a row! Bucky ftw! :)

  • whats the difference between a nested if statement and a normal if statement?

  • @Statifyable Nested is a if statment withing a if statment that will only exceute if the most outer if statment was true

  • @Statifyable A nested If/else statement is an if/else statement that is inside another if/else statement

  • Thank you. You are way better than my college teacher!

  • if i don't go to work tomorrow. i might get fired. else if i go will hate the job. else i quit i have no money.

  • u are dng a grt job.....thnx..

  • I have a question.... how do i make it so that I can repeatedly input a string with the scanner. would i need to make multiple scanners or is there a way to do it with one. im making a number guessing game (of course xD) and i want to make it so that if i guess wrong then i am able to keep guessing till i am right.

    Thank you in advance!

  • @krnxmaster

    i'm a beginner at this too, but let's see if i can get that right...

    you don't have to make multiple scanners, just import the Scanner (import java.util.Scanner)

    Then do that Scanner Input = new Scanner(System.in); thing

    then put that all into the while loop that he talked about earlier.

    that way you can input, check, reinput, recheck until you get the guess == number.

    of course, you can set it to if guess == number then break out of the loop.

    hope that made sense...

  • @necoconecochan Thanks, i fixed it up and its working great now.

  • @krnxmaster maybe there is a better way of doing this, but this is what I did:

    import java.util.Scanner;

    public class guessNumber{ public static void main (String[] args){ int number = 2; int userNumber; Scanner input = new Scanner(System.in); System.out.println("Please enter your number"); userNumber = input.nextInt();

     while(userNumber != number) { System.out.println("You guess wrong try again"); userNumber = input.nextInt();} }

  • I noticed all this if else statements work with no curly braces. weird

  • @carbidutz it will only do 1 thing but if you use curlies than you can do anything (multiple) things.

  • @Statifyable @tkblackbelt2 yeah, I figured that out now but thanks.

  • good tutorials

  • bucky rocks! \m/

  • that was again really easy, hope i get into the methods though...

    great tutorials by the way

  • hey bucky! I have one more question, what if there are more than 3 numbers involve in a nested if-else if statement? Like for example- if the number input from the user is >= 4 but must be <=9. what code should I put there? I've tried so many codes I saw on the net and whatever comes out to my mind but it did not worked.

  • @terryramos if (x>=4 && x<=9) {

    }

  • @GxgForLife Thanks a lot!!!  God Bless!! (^o^)

  • @GxgForLife Can I ask for some more questions if ever I'll be needing some answers? Thanks (^o^)

  • hey bucky! I'm a subscriber of this tutorial and I really Love it!. It's so helpful to me. But I have 1 more problem that remains unsolved. Using this NESTED IF statement. I've been trying to make a program with IF-else if inside If-else if statement. And I have noticed that the third and the rest If-else if statement I made inside If-else if were not working. What am I supposed to do?

  • hey bucky! I'm a subscriber of this tutorial and I really Love it!. It's so helpful to me. But I have 1 more problem that remains unsolved. Using this NESTED IF statement. I've been trying to make a program with IF-else if inside If-else if statement. And I have noticed that the third and the rest If-else if statement I made inside If-else if were not working. What am I supposed to do?

  • Hi Bucky, you're a good bloke. Where can I download your java tutorials at once please?

  • your not lazy your miracle

  • love your tutorials, man lol

  • Lol, the tutorials went from something really advanced to something really easy. :D

  • nice,, simple but nice,, it helps me for my exam

  • Very helpfull,,,nice

  • Bucky,cause of you I have finish my Master work: Basic in Java programming. Dude thanks a lot. You really are great.

  • guess this is one the best tutorials in YouTube!!

  • I agree. if statements are easier than all these methods and objects *sigh* but all are soo necessary...

  • The last 2 tutorials were really complicated.

  • ctrl + shift + f plz

  • you almost lost me there i was in your other advance programming tutorials

  • i want to know if nested class can be used in abstract class?

    with a word, abstract class can have nested class too? i need an reason also why it can or cant used in abstract class. Thanks a lot :)

  • @fakeface20 Did you get an answer to this?

  • Awesome videos bucky! thanks

    i have took a few java classes over a year ago in college then i switched my major and forgot most of what i learned and these have been great to refresh my java programming skills.

  • This seems a bit out of place :P

    This is a lot easier than all that class/object stuff b4 it

  • Thanks Bucky!!! it was a great vid!!

  • Again, great stuff! Love the southern accent. Makes it feel more down to earth.

  • Good tutorials, but I feel like the easier ones like these should have gone closer to the front.

  • Thanxxx!!!

    Last tut was a bit complicated but this wan was TOTALLY easy explained!!

  • He didn't write completely the last nested if statement that's why it compiled wrong.

  • You are the man..ive been watching all your tutorials and ill plan to watch the rest... seriously u are the man!!!

  • hey, please make a tutorial for nesting if statement to for loop statement please thanks

  • glad this was here...wow this cleared my head about "nested" if/if else statements..."on to the next one, Click!"...

  • What if you want put something like if my bowler speed is more than 140 Kmph but less than 155 than my bowler is a fast bowler or else he is a slow bowler. How do we put a range. plz help

  • @niksfloyd

    if (bowler_speed > 140 && bowler_speed < 155) {

    -do whatever-

    {

  • I hope nobody over 75 is watching those vids :D

  • I've been through a ton of Java tutorials and these are simply the best! This is the furthest I've got as most of the other ones are discontinued.

  • Why are you adding "{", your only using 1 line in the statements..

  • its a good habit?

  • Good work!

  • this is great. helped me alot at thet start of my educ. keep up the good work

  • The people that vote down these videos must pay millions of dollars for amazing teachers..

  • Great

  • Nice Vid

  • oh snap kewl!

  • Nice man!

Loading...
Alert icon
0 / 0