Java Programming Tutorial – 46 – Static

Home/Programming Video Tutorials/Java Video Tutorials/Java Programming Tutorial – 46 – Static

Java Programming Tutorial – 46 – Static

FavoriteLoadingAdd to favorites

Facebook – https://www.facebook.com/TheNewBoston-464114846956315/
GitHub – https://github.com/buckyroberts
Google+ – https://plus.google.com/+BuckyRoberts
LinkedIn – https://www.linkedin.com/in/buckyroberts
reddit – https://www.reddit.com/r/thenewboston/
Support – https://www.patreon.com/thenewboston
thenewboston – https://thenewboston.com/
Twitter – https://twitter.com/bucky_roberts

Java468x60
By | 2017-06-12T01:38:35+00:00 June 12th, 2017|Java Video Tutorials|50 Comments

50 Comments

  1. Christina Anderson June 12, 2017 at 1:39 am - Reply

    How come you put a %s for the name and not first or fn?

  2. ManOFSteel June 12, 2017 at 1:40 am - Reply

    41 feminists triggered.

  3. Sunny s June 12, 2017 at 1:40 am - Reply

    Where can I get good Java practice exercises in Topic wise format along with solutions ?
    Is there a website ?

  4. Yura Er June 12, 2017 at 1:41 am - Reply

    package bucky;
    import java.util.Scanner;
    import java.util.EnumSet;
    import java.util.Random;
    class apples {
    public static void main(String args[]){
    tuna member1 = new tuna("Megan", "Fox");
    tuna member2 = new tuna("Natalie", "Portman");

    }
    }

  5. Kamil Bolka June 12, 2017 at 1:43 am - Reply

    Good explanation mate

  6. John Smith June 12, 2017 at 1:45 am - Reply

    I’m confused, he could have just set that integer to public right?

  7. Arash K70 June 12, 2017 at 1:45 am - Reply

    Natalie portman is not hot bro

  8. Joseph Kreifels II June 12, 2017 at 1:50 am - Reply

    Does Taylor Swift know how to program with Swift?

  9. Kostas Lek June 12, 2017 at 1:51 am - Reply

    How can i create an equivalent program without the use of the static variable? What should i put into the method?

  10. raducamman June 12, 2017 at 1:54 am - Reply

    OMG! He just gave 3 objects women names. How come feminists haven’t brought hell to him?

  11. AJD June 12, 2017 at 1:56 am - Reply

    i actually googled Natalie before he told me to do so. LOL

  12. Nick O June 12, 2017 at 1:57 am - Reply

    These are the best tutorials on youtube for learning java

  13. C Liviu June 12, 2017 at 1:58 am - Reply

    FUCK I LOVE YOU!

  14. Said Sel-lam June 12, 2017 at 1:59 am - Reply

    dont give up Bucky! one day you will go out with a famous one

  15. Hüseyin Fadullah Güngör June 12, 2017 at 2:04 am - Reply

    For those who doesn’t understand why we used static term::: Everytime we call constructor we want to member increase. If we don’t put static in front of it, first time we call it it will be 1 before printing so it will say member=1, but when we create second object. Member will be again 0, then when it goes to constructor in it, it will increase to 1 again, so it doesn’t count how we want. It starts from zero, but we want number increase from where we left.
    I hope this helps.

  16. Kausar Patherya June 12, 2017 at 2:04 am - Reply

    *constructor
    (sorry)

  17. SkylarLynn Edits June 12, 2017 at 2:05 am - Reply

    If you want to date Megan Fox, Natalie Portman, or Taylor Swift. It might me be useful not to call them "Tuna"

  18. trueth1468 June 12, 2017 at 2:06 am - Reply

    who else googles natalie portman??

  19. S. OUCHENE June 12, 2017 at 2:06 am - Reply

    You should (must) always declare the first letter of class as UPPERCASE

  20. DMAX ONE June 12, 2017 at 2:08 am - Reply

    Make sure you spell it wrong hahahaha…

  21. Trixie Diane June 12, 2017 at 2:09 am - Reply

    taylor swift yas

  22. Eric Barnes June 12, 2017 at 2:09 am - Reply

    tuna member1 , tuna member2, and tuna member 3 LOL. tuna club

  23. Dom4z June 12, 2017 at 2:12 am - Reply

    I am slowly but steady arriving to a conclusion that Bucky had too much internet on women.

  24. Evgeni Kuzmov June 12, 2017 at 2:16 am - Reply

    how can it count how many people are in the club?

  25. Adi June 12, 2017 at 2:17 am - Reply

    potpie is the new tuna: neglected and forgotten class 🙁

  26. videovulcan June 12, 2017 at 2:18 am - Reply

    Natalie Roberts.
    Megan Roberts,
    Scarlett Roberts,
    Taylor Roberts,
    Roberts Roberts.
    ROBERTS
    ROBBERS
    ROB US
    ROB ME
    RODNEY

    Only fools and horses…

  27. Khaled Mohamed June 12, 2017 at 2:19 am - Reply

    difference between it and global variables ?

  28. Lion Power June 12, 2017 at 2:20 am - Reply

    watched this video and then google searched to know who Natalie Portman is, watched No Strings Attached and it is awesome 😐 and gotta watch the 48th tutorial 😐 😐

  29. Brawl726 June 12, 2017 at 2:20 am - Reply

    Are constructor and method the same thing? Please clarify the difference. Thank you.

  30. Deedit June 12, 2017 at 2:20 am - Reply

    I like how he just does all of those tutorials in like one single week

  31. FLy1nRabBit June 12, 2017 at 2:21 am - Reply

    "Make sure you spelled it wrong."
    > lmao

  32. Joseph Kreifels II June 12, 2017 at 2:24 am - Reply

    Does a static variable use the same memory address? Or is there a new address for every instance just pointing to one spot in memory?

  33. shizyninjarocks June 12, 2017 at 2:26 am - Reply

    This is the first explanation that actually makes sense. THANKY SPANKY!!!

  34. Edo 281 June 12, 2017 at 2:26 am - Reply

    When I run this program it outputs "null null" for the first and second name, I checked and everything looks the same. Can anyone help?

    public tuna(String fn, String ln){
    fn = first;
    ln = last;
    members ++;

    System.out.printf("Constructor for %s %s, members now: %dn", first,last,members);
    }

    OUTPUT:
    Constructor for null null, members now: 1
    Constructor for null null, members now: 2

  35. Captain Angry June 12, 2017 at 2:26 am - Reply

    whats the difference between that and a regular int member then?

  36. dole45 June 12, 2017 at 2:28 am - Reply

    Here’s a question: How do I know when to put static in my methods? thanks to my IDE showing me error messages when i forget it i manage, but it’d be nice to know if there are any specific things to remember or any tricks. Thx for any advice 😀

  37. Shreyas Waghmare June 12, 2017 at 2:28 am - Reply

    5:40 I like this guy 😛

  38. Luboš Ťapušík June 12, 2017 at 2:29 am - Reply

    When you say object you most of the time mean instance I think:)
    I mean "tuna" is the object. "member1", "member2", "member3" are instances of the object tuna.

  39. Mulberry 3D Music June 12, 2017 at 2:30 am - Reply

    this is the weirdest programming tut i have ever watched

  40. You're mom June 12, 2017 at 2:30 am - Reply

    Half of the reason i watch these is to laugh

  41. RoidzGaming June 12, 2017 at 2:30 am - Reply

    I love this guy lol

  42. Thiago Farias June 12, 2017 at 2:32 am - Reply

    hottie with a body cutie with booty hahah 🙂 . Great lesson. Thank you.

  43. Nick Palmer June 12, 2017 at 2:32 am - Reply

    "If you don’t know who that is, definitely google it" Im crying here.

  44. GTdapoonk June 12, 2017 at 2:32 am - Reply

    How does it know to print 3 times?

  45. Dubis June 12, 2017 at 2:33 am - Reply

    B-But couldn’t you just do this?:

    class orange{
    public static void main(String[] args){
    int memnum = 0;
    String member[] = new String[3];
    member[0]="Megan Fox";
    ++memnum;
    System.out.println(member[0] + " joined, members in the club:" + memnum);

    member[1]="Natalie Portman";
    ++memnum;
    System.out.println(member[1] + " joined, members in the club:" + memnum);

    member[2]="Taylor Swift";
    ++memnum;
    System.out.println(member[2] + " joined, members in the club:" + memnum);
    }
    }

  46. wane kill June 12, 2017 at 2:33 am - Reply

    For anyone who is confused why we should use the static… just remove the static keyword and run it as a normal private global variable – cheers!

  47. Arkadiusz Jan Dylewski June 12, 2017 at 2:33 am - Reply

    For anyone who does not know this. %d is for at integer value, and %s is for a string value.

  48. Heli Copter June 12, 2017 at 2:33 am - Reply

    Arigato Roberts-Sensei!

  49. willzurmacht June 12, 2017 at 2:36 am - Reply

    WTH I typed Taylor Swift on my second list and he just added her on the third one. What a close coincidence 😮

  50. puru June 12, 2017 at 2:36 am - Reply

    Hang on, I just realized how similar you sound to videogamedunkey. Holy crap.

Leave A Comment

*